non-reentrant mutex problem in objectRef.cc

Mark Little M.C.Little@ncl.ac.uk
Fri, 07 Nov 1997 18:27:48 +0000


I don't think this has been addressed before, but I've come across
an interesting mutex lock problem in objectRef.cc on Solaris, using
pthreads:

I have an implementation object A which contains a reference to some
other Orb object B. For simplicity assume there's only a single thread
running in the application when I call _dispose on A, and in A's
destructor it
calls release on B. The problem is that omniOrb (correctly) protects
its internal object tables with a mutex, and A effectively acquires this
when _dispose is called. _dispose then (while still holding the mutex)
calls the destructor of A. When A calls release on B it dives back
into objectRef to get the mutex and because pthread mutexes on Solaris
aren't reentrant, the thread blocks waiting for itself.

Mark.

-----------------------------------------------------------------------
SENDER : Dr. Mark Little, Arjuna Project, Distributed Systems Research.
PHONE  : +44 191 222 8066, FAX : +44 191 222 8232
POST   : Department of Computing Science, University of Newcastle upon
	 Tyne, UK, NE1 7RU
EMAIL  : M.C.Little@newcastle.ac.uk