Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move some content to the SynchroRaw dtor
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 12 May 2016 18:18:30 +0000 (20:18 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 12 May 2016 18:18:30 +0000 (20:18 +0200)
src/simix/SynchroRaw.cpp
src/simix/SynchroRaw.hpp
src/simix/smx_synchro.cpp

index 872cf47..3bb881d 100644 (file)
@@ -9,6 +9,10 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
 
+simgrid::simix::Raw::~Raw()
+{
+  sleep->unref();
+}
 void simgrid::simix::Raw::suspend()
 {
   /* The suspension of raw synchros is delayed to when the process is rescheduled. */
index 3c920fa..7086bd3 100644 (file)
@@ -15,6 +15,7 @@ namespace simix {
   /** Used to implement mutexes, semaphores and conditions */
   XBT_PUBLIC_CLASS Raw : public Synchro {
   public:
+    ~Raw();
     void suspend() override;
     void resume() override;
     void post() override;
index 442695e..cb9212a 100644 (file)
@@ -69,7 +69,6 @@ void SIMIX_synchro_destroy(smx_synchro_t synchro)
   XBT_DEBUG("Destroying synchro %p", synchro);
   simgrid::simix::Raw *raw = static_cast<simgrid::simix::Raw*>(synchro);
 
-  raw->sleep->unref();
   delete raw;
 }