This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] PR/12647: MinGW: Respect refcount in _Jv_CondWait
- From: Tom Tromey <tromey at redhat dot com>
- To: gnustuff at thisiscool dot com
- Cc: java-patches at gcc dot gnu dot org
- Date: 23 Oct 2003 11:28:23 -0600
- Subject: Re: [PATCH] PR/12647: MinGW: Respect refcount in _Jv_CondWait
- References: <MIFDGBLFH9ICH3GDWVURQLYUMILI.3f979e2c@p733>
- Reply-to: tromey at redhat dot com
>>>>> "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