RWMutexLock Recursive Acquisition error in Debug - Not True! - Threads 2.0.1 only

Article ID: 1051
Last updated: 31 Jan, 2008
Article ID: 1051
Last updated: 31 Jan, 2008
Revision: 1
Views: 3107
Posted: 29 Nov, 2000
by Dean J.
Updated: 31 Jan, 2008
by Dean J.
Problem


We get a recursive mutex lock acquisition failure, and there is absolutely NO way
this could be true.  We are absolutely sure that we are not doing this in our code.


Cause


There is an error in the mutex lock id code which can cause this problem.  The fix is to add an RWGuard object in four places in the synchronization file RWMutexLock.cpp.


Action


In RWMutexLock.cpp (found in the sync/src/ subdirectory), you will need to protect access to the thread Id using RWGuard objects.  This is achieved by placing a guard just before the call.  For example, on line 167, make this:

#  if defined(RWDEBUG)
   threadId_.invalidate();
#  endif

 

look like this:

 

#  if defined(RWDEBUG)
   RWGuard guard(mutex_);
   threadId_.invalidate();
#  endif

 

This "RWGuard guard (mutex_)" addition also occurs just before lines 416, 549, and 687 in the same file.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 1051
Last updated: 31 Jan, 2008
Revision: 1
Views: 3107
Posted: 29 Nov, 2000 by Dean J.
Updated: 31 Jan, 2008 by Dean J.

Others in this category