From: AlexeyD <da...@us...> - 2005-02-28 17:43:37
|
Update of /cvsroot/tora/tora In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14274 Modified Files: tothread.cpp Log Message: Fixed bug in toSemaphore::down() - wait() is now executed outside of critical section. Index: tothread.cpp =================================================================== RCS file: /cvsroot/tora/tora/tothread.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tothread.cpp 23 Feb 2005 23:47:17 -0000 1.38 --- tothread.cpp 28 Feb 2005 17:43:15 -0000 1.39 *************** *** 61,66 **** { Mutex.lock(); ! while(Value<=0) Condition.wait(&Mutex); Value--; Mutex.unlock(); --- 61,69 ---- { Mutex.lock(); ! while(Value<=0) { ! Mutex.unlock(); Condition.wait(&Mutex); + Mutex.lock(); + } Value--; Mutex.unlock(); |