Hello again Timothy!
The thread safe object is a native object written in C. I ensured this was
thread safe by asking the third party developers to whom the object
belongs...
I'll give the Native.synchronizedLibrary() call a try... I was not aware of
this, so its probably just what I'm missing!
Thanks again Timothy!
Drayton
2009/4/6 Timothy Wall <twal...@dev.java.net>
On Apr 6, 2009, at 6:41 AM, Drayton Brown wrote:
Hi all
I've written a threaded application which uses a thread safe shared
object, however when I run the application with more that one thread, the
jvm crashes out.
Is the "thread safe object" a Java object or a native one? What makes it
thread safe?
I've checked the JNA site for information on how the JNA wrapper handles
threading, but I've been unable to find any information. I was hoping
someone on the mailing list could give me more information on the topic, or
at least point me in the direction of the documentation on it.
JNA itself doesn't do anything special w/r/t threading. There is a
Native.synchronizedLibrary() call that may be used to ensure any calls to
your native library are serialized (i.e. no more than one call is ever
active at any given time).
Return error codes are saved on a per-thread basis.