Exemple #1
0
// notifies the JVM of your threads done-ness w/ it, and deallocates the associated
// environment pointer.  Depending on the exact JDK version, there are differing semantics
// on whether the 'original' thread can call this (else JVM Shutdown), but most modern
// stacks (>=1.2) should allow this from the 'main' thread.
func (self *JVM) DetachCurrentThread() (err error) {
	if 0 != C.vmDetachCurrentThread(self.jvm) {
		err = errors.New("Couldn't attach thread (and thus cannot gather exception)")
	} else {
		print("TODO: DetachCurrentThread - don't know which thread I am :-( (cant be unmapped)\n")
	}
	return
}
Exemple #2
0
// notifies the JVM of your threads done-ness w/ it, and deallocates the associated
// environment pointer.  Depending on the exact JDK version, there are differing semantics
// on whether the 'original' thread can call this (else JVM Shutdown), but most modern
// stacks (>=1.2) should allow this from the 'main' thread.
func (self *JVM) DetachCurrentThread() (err error) {
	if 0 != C.vmDetachCurrentThread(self.jvm) {
		err = errors.New("Couldn't attach thread (and thus cannot gather exception)")
	}
	return
}