Back to index

glibc  2.9
tst-robust3.c
Go to the documentation of this file.
00001 #include <time.h>
00002 #include <sys/time.h>
00003 
00004 
00005 static struct timespec tmo;
00006 
00007 
00008 #define PREPARE_TMO \
00009   do {                                                               \
00010     struct timeval tv;                                                      \
00011     gettimeofday (&tv, NULL);                                               \
00012                                                                      \
00013     /* Define the timeout as one hour in the future.  */                    \
00014     tmo.tv_sec = tv.tv_sec + 3600;                                   \
00015     tmo.tv_nsec = 0;                                                 \
00016   } while (0)
00017 
00018 
00019 #define LOCK(m) pthread_mutex_timedlock (m, &tmo)
00020 #include "tst-robust1.c"