summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorpdw <>2004-01-20 09:51:48 +0000
committerpdw <>2004-01-20 09:51:48 +0000
commit382684dc2451fca24dd59f54013170ece9a2d427 (patch)
treeaf5260c4611413785667a787e9e3a9590e33b960 /config
parent50cab8a742f1458a28ad6d141accde7fce7ce6c3 (diff)
downloadiftop-382684dc2451fca24dd59f54013170ece9a2d427.zip
*** empty log message ***
Diffstat (limited to 'config')
-rw-r--r--config/pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/pthread.c b/config/pthread.c
index ae39e4d..a682e33 100644
--- a/config/pthread.c
+++ b/config/pthread.c
@@ -12,6 +12,7 @@ static const char rcsid[] = "$Id$";
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <unistd.h>
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
@@ -23,8 +24,10 @@ void *worker_thread(void *v) {
pthread_mutex_lock(&mtx);
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mtx);
- while (1)
+ while (1) {
+ sleep(1);
pthread_testcancel();
+ }
}
/* Start a thread, and have it set a variable to some other value, then signal