diff options
author | erdgeist <> | 2008-10-07 23:44:59 +0000 |
---|---|---|
committer | erdgeist <> | 2008-10-07 23:44:59 +0000 |
commit | ec0affa97de870f3acd280afff728adccd48b2c8 (patch) | |
tree | 815bb871f6ac62a7ada26217b4a8d649ea8e57de /ot_sync.c | |
parent | 1c3c5d57dafc44c582a6d29a7db04cfeba2464da (diff) |
allow threads to be named. not posix compliant.
Diffstat (limited to 'ot_sync.c')
-rw-r--r-- | ot_sync.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -10,6 +10,9 @@ | |||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <string.h> | 11 | #include <string.h> |
12 | #include <pthread.h> | 12 | #include <pthread.h> |
13 | #ifdef WANT_THREAD_NAME_NP | ||
14 | #include <pthread_np.h> | ||
15 | #endif | ||
13 | 16 | ||
14 | /* Libowfat */ | 17 | /* Libowfat */ |
15 | #include "scan.h" | 18 | #include "scan.h" |
@@ -151,6 +154,9 @@ static void * sync_worker( void * args) { | |||
151 | static pthread_t thread_id; | 154 | static pthread_t thread_id; |
152 | void sync_init( ) { | 155 | void sync_init( ) { |
153 | pthread_create( &thread_id, NULL, sync_worker, NULL ); | 156 | pthread_create( &thread_id, NULL, sync_worker, NULL ); |
157 | #ifdef WANT_THREAD_NAME_NP | ||
158 | pthread_set_name_np( thread_id, "opentracker (batchsync)"); | ||
159 | #endif | ||
154 | } | 160 | } |
155 | 161 | ||
156 | void sync_deinit( ) { | 162 | void sync_deinit( ) { |