Using a recursive mutex for dout is desirable because it allows us to
survive situations like this:
> foo() { dout << "foo" << dendl; }
> dout(0) << foo() << dendl;
These cases should be fixed because they produce garbled output.
However, with this change, at least they will not cause deadlock.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
* The dout lock protects calls to dout()
* TODO: needs to become part of CephContext
*/
-pthread_mutex_t _dout_lock = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t _dout_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
class CephContextServiceThread : public Thread
{