[PATCH]: natThread.cc: Destroy join sync objects in finalizer

Tom Tromey tromey@redhat.com
Fri Sep 17 19:53:00 GMT 2004


>>>>> "Bryce" == Bryce McKinlay <mckinlay@redhat.com> writes:

Bryce> Right, with my scheme above, no extra synchronization would be
Bryce> needed. It would still be safe to synchronize on the native state
Bryce> (join_mutex, etc), if thread->nt is non-null. The native state would
Bryce> not be destroyed until its finializer is run, so if a thread sees it
Bryce> as non-null, there is no danger of a race.

Perhaps you need to synchronize when changing the value of thread->nt.
I suppose there are other places where we assume pointer writes are
atomic.

Bryce> And, by registering the finalizier on the native state rather than the
Bryce> Thread object, we avoid conflicts with user finalizers.

This is what we do now.

Tom



More information about the Java-patches mailing list