COSA
An Object-Oriented Platform for Arduino Programming
Mutex.hh File Reference
#include "Semaphore.hh"
Include dependency graph for Mutex.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Nucleo::Mutex
 

Namespaces

 Nucleo
 

Macros

#define mutex(s)   for (uint8_t i = (s.wait(), 1); i != 0; i--, s.signal())
 

Detailed Description

Version
1.0

License

Copyright (C) 2014-2015, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Definition in file Mutex.hh.

Macro Definition Documentation

#define mutex (   s)    for (uint8_t i = (s.wait(), 1); i != 0; i--, s.signal())

Syntactic sugar for mutual exclusive block. Used in the form:

1 Nucleo::Semaphore s(1);
2 ...
3 mutex(s) {
4  ...
5 }

Definition at line 63 of file Mutex.hh.