Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make Semaphore::~Sepmaphore() private.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 15 Mar 2021 22:04:41 +0000 (23:04 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 15 Mar 2021 22:07:11 +0000 (23:07 +0100)
This is a followup to commit 993a22f9b7f34d3a536bfe6a49a31405461dea5d
"Add SemaphoreImpl::piface_ (mimic MutexImpl)."

include/simgrid/forward.h
include/simgrid/s4u/Semaphore.hpp

index d7179fd..e7e55e2 100644 (file)
@@ -131,6 +131,8 @@ namespace activity {
   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
   class SemaphoreImpl;
   using SemaphoreImplPtr = boost::intrusive_ptr<SemaphoreImpl>;
+  XBT_PUBLIC void intrusive_ptr_add_ref(SemaphoreImpl* sem);
+  XBT_PUBLIC void intrusive_ptr_release(SemaphoreImpl* sem);
   class SleepImpl;
   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
 
index b100ba5..159d0ac 100644 (file)
@@ -30,6 +30,7 @@ namespace s4u {
  */
 class XBT_PUBLIC Semaphore {
   friend kernel::activity::SemaphoreImpl;
+  friend void kernel::activity::intrusive_ptr_release(kernel::activity::SemaphoreImpl* sem);
 
   kernel::activity::SemaphoreImpl* const pimpl_;
 
@@ -37,6 +38,7 @@ class XBT_PUBLIC Semaphore {
   friend void intrusive_ptr_release(const Semaphore* sem);
 
   explicit Semaphore(kernel::activity::SemaphoreImpl* sem) : pimpl_(sem) {}
+  ~Semaphore() = default;
 #ifndef DOXYGEN
   Semaphore(Semaphore const&) = delete;            // No copy constructor. Use SemaphorePtr instead
   Semaphore& operator=(Semaphore const&) = delete; // No direct assignment either. Use SemaphorePtr instead