
20 Jun
2006
20 Jun
'06
9:32 a.m.
Le Sat, 10 Jun 2006 00:51:28 -0300, Bruno Martínez a écrit :
You can protext the lock with another, short-lived, lock:
mutex m1; mutex m2; mutex::lock g_lk(m2, false);
lib_lock() { mutex::lock lk(m1); g_lk.lock(); }
lib_unlock() { mutex::lock lk(m1); g_lk.unlock(); }
This isn't 100% OK because the lock is used from different threads, but should work.
As I'm new myself to MT programming, why isn't this 100% OK? I can't see how it could fail. Curiously, Nowhere man -- nowhere.man@levallois.eu.org OpenPGP 0xD9D50D8A