Commit e204656c authored by Marcelo Aquino's avatar Marcelo Aquino

add static initialization for pthread mutexes

The documentation says:
"In cases where default mutex attributes are appropriate, the macro
PTHREAD_MUTEX_INITIALIZER can be used to initialize mutexes that are
statically allocated. The effect shall be equivalent to dynamic
initialization by a call to pthread_mutex_init() with parameter attr
specified as NULL, except that no error checks are performed."
parent 95926b2c
......@@ -23,7 +23,7 @@ see <http://www.gnu.org/licenses/>
#define delay(x) bcm2835_delay(x)
static pthread_mutex_t pinMutex ;
static pthread_mutex_t pinMutex = PTHREAD_MUTEX_INITIALIZER;
static volatile int pinPass = -1 ;
pthread_t threadId [64];
......
#include "spi.h"
#include <pthread.h>
static pthread_mutex_t spiMutex;
static pthread_mutex_t spiMutex = PTHREAD_MUTEX_INITIALIZER;
SPI::SPI() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment