COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Mutex.hh
Go to the documentation of this file.
1
21
#ifndef COSA_NUCLEO_MUTEX_HH
22
#define COSA_NUCLEO_MUTEX_HH
23
24
#include "
Semaphore.hh
"
25
26
namespace
Nucleo
{
27
33
class
Mutex
{
34
public
:
40
Mutex
(
Semaphore
& sem) : m_sem(sem) { m_sem.
wait
(); }
41
45
~Mutex
() { m_sem.
signal
(); }
46
47
private
:
48
Semaphore
& m_sem;
49
};
50
51
};
52
63
#define mutex(s) for (uint8_t i = (s.wait(), 1); i != 0; i--, s.signal())
64
65
#endif
Nucleo
Definition:
Actor.hh:26
Nucleo::Semaphore::wait
void wait(uint8_t count=1)
Definition:
Semaphore.cpp:27
Semaphore.hh
Nucleo::Semaphore::signal
void signal(uint8_t count=1, bool flag=true)
Definition:
Semaphore.cpp:40
Nucleo::Semaphore
Definition:
Semaphore.hh:32
Nucleo::Mutex
Definition:
Mutex.hh:33
Nucleo::Mutex::Mutex
Mutex(Semaphore &sem)
Definition:
Mutex.hh:40
Nucleo::Mutex::~Mutex
~Mutex()
Definition:
Mutex.hh:45
libraries
Nucleo
Mutex.hh
Generated on Thu Aug 31 2017 17:02:03 for COSA by
1.8.11