YARP
Yet Another Robot Platform
Semaphore.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_SEMAPHORE_H
8 #define YARP_OS_SEMAPHORE_H
9 
10 #include <yarp/os/api.h>
11 
12 namespace yarp {
13 namespace os {
14 
26 {
27 public:
32  Semaphore(unsigned int initialCount = 1);
33 
37  virtual ~Semaphore();
38 
44  void wait();
45 
46 
57  bool waitWithTimeout(double timeoutInSeconds);
58 
59 
66  bool check();
67 
72  void post();
73 
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75 private:
76  class Private;
77  Private* mPriv;
78 #endif // DOXYGEN_SHOULD_SKIP_THIS
79 };
80 
81 } // namespace os
82 } // namespace yarp
83 
84 #endif // YARP_OS_SEMAPHORE_H
A class for thread synchronization and mutual exclusion.
Definition: Semaphore.h:26
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18