From: Jean-Philippe Orsini Date: Sun, 10 Aug 2014 12:35:03 +0000 (+0200) Subject: use pmutex X-Git-Tag: v1.1.1~26 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=d8931ab364ed85493da0cd1ba70a94a1f4882231 use pmutex --- diff --git a/src/lib/slog.c b/src/lib/slog.c index 99eb536..7174ba4 100644 --- a/src/lib/slog.c +++ b/src/lib/slog.c @@ -34,6 +34,7 @@ #include "bool.h" #include "config.h" #include +#include #include "ptime.h" #include "slog.h" @@ -169,9 +170,9 @@ static void *slog_routine(void *data) { while (1) { pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - pthread_mutex_lock(sensors_mutex); + pmutex_lock(sensors_mutex); slog_write_sensors(sensors); - pthread_mutex_unlock(sensors_mutex); + pmutex_unlock(sensors_mutex); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); sleep(period); }