From: Markus R. <rol...@un...> - 2007-03-15 21:53:48
|
Hi, Yuan Xu wrote: > Firstly, I create a global mutex that all ruby functions should call > before doing anything. But it will cause dead lock, because there are > recursive calls between Ruby and C++. [...] You could use a recursive mutex to avoid this. This kind of mutex allows the owning thread to lock it repeatedly without deadlocking. The boost library contains a boost/thread/recursive_mutex.hpp file for this purpose. regards. Markus |