This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
This was proposed about two months ago:
if >a finalizer needs to be run before the finalizer thread has finishedYes, we could rewrite it using _Jv_CondWait/_Jv_CondNotify and other thread primitives defined in the thread headers.
I'm also not sure this peice of code in FinalizerThread is safe: public static void finalizerReady () { synchronized (lock) { if (! thread_started) runFinalizers ();
Isn't there a race here? Unlikely to happen, perhaps, but it seems like
starting, we'll try to run finalizers from the inside the GC's thread.
Regards
Bryce
Is this that case? The two threads are deadlocked. The finalizer is
waiting for a monitor on the PlainSocketImpl.
// Main loop for the finalizer thread.
void
gnu::gcj::runtime::FinalizerThread::run ()
{
while (true)
{
_Jv_MutexLock (&mutex);
if (! finalizer_ready)
_Jv_CondWait (&condition, &mutex, 0, 0);
finalizer_ready = false;
_Jv_MutexUnlock (&mutex);
_Jv_RunFinalizers ();
}
}| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |