Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't give actors a chance to survive their exec if their host is turned off
[simgrid.git] / src / kernel / activity / MutexImpl.hpp
index 53543b6..52256b0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -25,6 +25,8 @@ public:
   bool try_lock(smx_actor_t issuer);
   void unlock(smx_actor_t issuer);
 
+  MutexImpl* ref();
+  void unref();
   bool locked       = false;
   smx_actor_t owner = nullptr;
   // List of sleeping processes:
@@ -42,11 +44,11 @@ public:
       delete mutex;
   }
 
-  simgrid::s4u::Mutex& mutex() { return mutex_; }
+  simgrid::s4u::Mutex& mutex() { return piface_; }
 
 private:
   std::atomic_int_fast32_t refcount_{1};
-  simgrid::s4u::Mutex mutex_;
+  simgrid::s4u::Mutex piface_;
 };
 }
 }