[ekiga/v4_0] Engine: Fixed a few mutexes that could be left in Waiting state.



commit 21760b0a69eae73a09cc9053a84c83c3e56a8548
Author: Damien Sandras <dsandras beip be>
Date:   Sun Mar 3 12:51:54 2013 +0100

    Engine: Fixed a few mutexes that could be left in Waiting state.
    
    This is essentially cosmetic. However, it could lead to an Assertion
    when ptlib is compiled in DEBUG mode. This is ended better to make sure
    a mutex is in "neutral" state when being destroyed and not waiting for
    the corresponding Signal operation.

 .../dx-videooutput/videooutput-manager-dx.cpp      |    3 ++-
 lib/engine/videoinput/videoinput-core.cpp          |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp 
b/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
index 388bcdd..1387d31 100644
--- a/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
+++ b/lib/engine/components/dx-videooutput/videooutput-manager-dx.cpp
@@ -58,7 +58,8 @@ void GMVideoOutputManager_dx::quit ()
 {
   end_thread = true;
   run_thread.Signal();
-  thread_ended.Wait();
+
+  PWaitAndSignal m(thread_ended);
 }
 
 bool
diff --git a/lib/engine/videoinput/videoinput-core.cpp b/lib/engine/videoinput/videoinput-core.cpp
index f3a84ba..4bef47d 100644
--- a/lib/engine/videoinput/videoinput-core.cpp
+++ b/lib/engine/videoinput/videoinput-core.cpp
@@ -70,7 +70,7 @@ void VideoInputCore::VideoPreviewManager::quit ()
     stop();
   end_thread = true;
   run_thread.Signal();
-  thread_ended.Wait();
+  PWaitAndSignal m(thread_ended);
 }
 
 void VideoInputCore::VideoPreviewManager::start (unsigned _width, unsigned _height)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]