mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
dout: use recursive mutex for dout
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>
This commit is contained in:
parent
44770df843
commit
e340bfe13d
@ -33,7 +33,7 @@ DoutStreambuf <char, std::basic_string<char>::traits_type> *_doss(g_ceph_context
|
||||
* 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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user