mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
helgrind/tests/cond_timedwait_invalid: Port to Darwin 10.8
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12213
This commit is contained in:
parent
5e7b95ac45
commit
a37ce6c407
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
@ -8,8 +9,13 @@ int main()
|
||||
struct timespec abstime;
|
||||
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
|
||||
|
||||
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
assert(clock_gettime(CLOCK_REALTIME, &abstime)==0);
|
||||
#else
|
||||
abstime.tv_sec = time(NULL) + 2;
|
||||
abstime.tv_nsec = 0;
|
||||
#endif
|
||||
abstime.tv_nsec += 1000000000;
|
||||
|
||||
assert(pthread_mutex_lock(&mutex)==0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user