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_clean.c | |
parent | 1c3c5d57dafc44c582a6d29a7db04cfeba2464da (diff) |
allow threads to be named. not posix compliant.
Diffstat (limited to 'ot_clean.c')
-rw-r--r-- | ot_clean.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -8,6 +8,9 @@ | |||
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <pthread.h> | 9 | #include <pthread.h> |
10 | #include <sys/uio.h> | 10 | #include <sys/uio.h> |
11 | #ifdef WANT_THREAD_NAME_NP | ||
12 | #include <pthread_np.h> | ||
13 | #endif | ||
11 | 14 | ||
12 | /* Libowfat */ | 15 | /* Libowfat */ |
13 | #include "byte.h" | 16 | #include "byte.h" |
@@ -126,6 +129,9 @@ void clean_all_torrents( ) { | |||
126 | static pthread_t thread_id; | 129 | static pthread_t thread_id; |
127 | void clean_init( void ) { | 130 | void clean_init( void ) { |
128 | pthread_create( &thread_id, NULL, clean_worker, NULL ); | 131 | pthread_create( &thread_id, NULL, clean_worker, NULL ); |
132 | #ifdef WANT_THREAD_NAME_NP | ||
133 | pthread_set_name_np( thread_id, "opentracker (cleanup)"); | ||
134 | #endif | ||
129 | } | 135 | } |
130 | 136 | ||
131 | void clean_deinit( void ) { | 137 | void clean_deinit( void ) { |