This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
mutex failing (stupid C++!)
- From: skaller <skaller at users dot sourceforge dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 31 Oct 2007 16:28:09 +1100
- Subject: mutex failing (stupid C++!)
Arggg .. C++ is such a mess.. look at this and spot the bug:
{
flx_mutex_locker_t (*ehd->spawner_lock);
fprintf(stderr,"Thread %p acquired mutex\n", pthread_self());
*ehd->spawner_flag=true;
ehd->spawner_cond->broadcast();
fprintf(stderr,"Thread %p releasing mutex\n", pthread_self());
}
This baffled me for 3 days now. The code is legal, it just
doesn't do what I expected. The fix is ONE CHARACTER.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net