]> AND Private Git Repository - loba.git/blobdiff - synchro.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
xbt_cond_timedwait has changed and doesn't throw exception anymore.
[loba.git] / synchro.h
index 07897e04febe1eea9075db9590c4bf9571dff2dd..bd49783ccdc943f2710ed76f9e4e60787fb0b5cf 100644 (file)
--- a/synchro.h
+++ b/synchro.h
@@ -1,7 +1,6 @@
 #ifndef SYNCHRO_H
 #define SYNCHRO_H
 
-#include <xbt/ex.hpp>
 #include <xbt/synchro.h>
 
 class mutex_t {
@@ -25,12 +24,7 @@ public:
     void signal()               { xbt_cond_signal(cond);            }
     void wait(mutex_t& mutex)   { xbt_cond_wait(cond, mutex.mutex); }
     bool timedwait(mutex_t& mutex, double delay) {
-        try {
-            xbt_cond_timedwait(cond, mutex.mutex, delay);
-        }
-        catch (const xbt_ex& e) {
-            if (e.category != timeout_error)
-                throw;
+        if (xbt_cond_timedwait(cond, mutex.mutex, delay)) {
             mutex.acquire();
             return false;       // got a timeout
         }