Commit d89ff7e1 authored by TMRh20's avatar TMRh20 Committed by GitHub

Merge pull request #273 from marceloaqno/fix-mutex-init

add static initialization for pthread mutexes
parents aaa09e18 e204656c
...@@ -23,7 +23,7 @@ see <http://www.gnu.org/licenses/> ...@@ -23,7 +23,7 @@ see <http://www.gnu.org/licenses/>
#define delay(x) bcm2835_delay(x) #define delay(x) bcm2835_delay(x)
static pthread_mutex_t pinMutex ; static pthread_mutex_t pinMutex = PTHREAD_MUTEX_INITIALIZER;
static volatile int pinPass = -1 ; static volatile int pinPass = -1 ;
pthread_t threadId [64]; pthread_t threadId [64];
......
#include "spi.h" #include "spi.h"
#include <pthread.h> #include <pthread.h>
static pthread_mutex_t spiMutex; static pthread_mutex_t spiMutex = PTHREAD_MUTEX_INITIALIZER;
SPI::SPI() { 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