From 250c00b20a41a9ebb1d1039eaa4ec96f9fa4eb7b Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 30 Apr 2018 18:50:02 +0200 Subject: [PATCH 1/1] Filx build with SimGrid 3.14. --- simgrid_features.h | 4 ++-- synchro.h | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/simgrid_features.h b/simgrid_features.h index 3de11a0..82c7b23 100644 --- a/simgrid_features.h +++ b/simgrid_features.h @@ -3,8 +3,8 @@ #include -#if !defined(SIMGRID_VERSION) || SIMGRID_VERSION < 31200UL // == SG < 3.12 == // -# error "Unsupported SimGrid version. Need version >= 3.12" +#if !defined(SIMGRID_VERSION) || SIMGRID_VERSION < 31400UL // == SG < 3.14 == // +# error "Unsupported SimGrid version. Need version >= 3.14" #endif // =================================================================== // #endif // !SIMGRID_FEATURES_H diff --git a/synchro.h b/synchro.h index fed9e87..07897e0 100644 --- a/synchro.h +++ b/synchro.h @@ -1,7 +1,8 @@ #ifndef SYNCHRO_H #define SYNCHRO_H -#include +#include +#include class mutex_t { public: @@ -24,14 +25,12 @@ 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) { - xbt_ex_t e; - TRY { + try { xbt_cond_timedwait(cond, mutex.mutex, delay); } - CATCH (e) { + catch (const xbt_ex& e) { if (e.category != timeout_error) - RETHROW; - xbt_ex_free(e); + throw; mutex.acquire(); return false; // got a timeout } -- 2.39.5