Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / include / simgrid / s4u / Semaphore.hpp
index 8520d61a94d0f65f70d679fc84c62a46dd29851c..6dcb9a4ea197e2c813df01b68c3125917dc85f45 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2023. 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. */
@@ -7,7 +7,6 @@
 #define SIMGRID_S4U_SEMAPHORE_HPP
 
 #include <simgrid/forward.h>
-#include <simgrid/simix.h>
 
 namespace simgrid {
 namespace s4u {
@@ -31,13 +30,13 @@ namespace s4u {
 class XBT_PUBLIC Semaphore {
 #ifndef DOXYGEN
   friend kernel::activity::SemaphoreImpl;
-  friend void kernel::activity::intrusive_ptr_release(kernel::activity::SemaphoreImpl* sem);
+  friend XBT_PUBLIC void kernel::activity::intrusive_ptr_release(kernel::activity::SemaphoreImpl* sem);
 #endif
 
   kernel::activity::SemaphoreImpl* const pimpl_;
 
-  friend void intrusive_ptr_add_ref(const Semaphore* sem);
-  friend void intrusive_ptr_release(const Semaphore* sem);
+  friend XBT_PUBLIC void intrusive_ptr_add_ref(const Semaphore* sem);
+  friend XBT_PUBLIC void intrusive_ptr_release(const Semaphore* sem);
 
   explicit Semaphore(kernel::activity::SemaphoreImpl* sem) : pimpl_(sem) {}
   ~Semaphore() = default;
@@ -51,6 +50,7 @@ public:
   static SemaphorePtr create(unsigned int initial_capacity);
 
   void acquire();
+  /** Returns true if there was a timeout */
   bool acquire_timeout(double timeout);
   void release();
   int get_capacity() const;