mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-12 22:24:53 +00:00
Only call pthread_condattr_setclock() if it's available in libpthread.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8648
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <pthread.h>
|
||||
@@ -32,8 +33,10 @@ public:
|
||||
pthread_mutexattr_destroy(&mutexattr);
|
||||
pthread_condattr_t condattr;
|
||||
pthread_condattr_init(&condattr);
|
||||
#if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK)
|
||||
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
|
||||
pthread_cond_init(&m_cond, 0);
|
||||
#endif
|
||||
pthread_cond_init(&m_cond, &condattr);
|
||||
pthread_condattr_destroy(&condattr);
|
||||
}
|
||||
~Monitor()
|
||||
|
||||
Reference in New Issue
Block a user