This is the mail archive of the java-patches@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]

Re: [PATCH] PR/12647: MinGW: Respect refcount in _Jv_CondWait


>>>>> "Mohan" == Mohan Embar <gnustuff@thisiscool.com> writes:

Mohan> If I don't hear from anyone in a few days, I'll
Mohan> check this in. (I still prefer letting things
Mohan> sit for awhile so people can catch any formatting
Mohan> errors and stuff.)

MMohan> +  while (curcount > 0)
Mohan> +    {  
Mohan> +      _Jv_MutexUnlock (mu);
Mohan> +      --curcount;
Mohan> +    }

I looked through the code a bit.  I notice that _Jv_MutexLock enters
the critical section with each call.  But really, don't we only need
to do that once, since we're explicitly keeping the lock count?

It seems to me that this code could work along the lines of the POSIX
code.  And then in this case the above could be simplified; see
posix-threads.h and posix-threads.cc.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]