santazhang / simple-rpc

Simple RPC in C++, with Python binding
http://www.yzhang.net/simple-rpc/
BSD 3-Clause "New" or "Revised" License
27 stars 6 forks source link

Cannot close ClientPool when no Clients are created #11

Closed santazhang closed 10 years ago

santazhang commented 10 years ago

Encountered this problem when implementing TRL project. Note that it might have been caused by the locking in RLog.

santazhang commented 10 years ago

Located problem in santazhang/trl@59170c91ab2ab1b1686a05344f926523c342d258.

santazhang commented 10 years ago

It turned out to be an issue of santazhang/base-utils

Fix and comment (logging.cc):

// Using recursive mutex, because it might be possible that a Log operation
// is interrupted by a signal, and then inside the signal handler, Log is
// called again. Using recursive mutex prevents the thread from deadlocking
// itself. See issue 11 on github.com/santazhang/simple-rpc
pthread_mutex_t Log::m_s = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;