summaryrefslogtreecommitdiff
path: root/ot_sync.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2008-10-07 23:44:59 +0000
committerDirk Engling <erdgeist@erdgeist.org>2008-10-07 23:44:59 +0000
commitad7c574c0e027de7f0d6b84424c5fa67e12fa081 (patch)
tree6799091e84d5498db836422f7da1843012c48fa0 /ot_sync.c
parent779df224097a983750161c3fd30f513c3b59be60 (diff)
downloadopentracker-ad7c574c0e027de7f0d6b84424c5fa67e12fa081.tar.gz
opentracker-ad7c574c0e027de7f0d6b84424c5fa67e12fa081.zip
allow threads to be named. not posix compliant.
Diffstat (limited to 'ot_sync.c')
-rw-r--r--ot_sync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ot_sync.c b/ot_sync.c
index b9303c9..7cad20e 100644
--- a/ot_sync.c
+++ b/ot_sync.c
@@ -10,6 +10,9 @@
#include <stdio.h>
#include <string.h>
#include <pthread.h>
+#ifdef WANT_THREAD_NAME_NP
+#include <pthread_np.h>
+#endif
/* Libowfat */
#include "scan.h"
@@ -151,6 +154,9 @@ static void * sync_worker( void * args) {
static pthread_t thread_id;
void sync_init( ) {
pthread_create( &thread_id, NULL, sync_worker, NULL );
+#ifdef WANT_THREAD_NAME_NP
+ pthread_set_name_np( thread_id, "opentracker (batchsync)");
+#endif
}
void sync_deinit( ) {
@@ -163,4 +169,4 @@ void sync_deliver( int64 socket ) {
#endif
-const char *g_version_sync_c = "$Source: /home/cvsroot/opentracker/ot_sync.c,v $: $Revision: 1.6 $\n";
+const char *g_version_sync_c = "$Source: /home/cvsroot/opentracker/ot_sync.c,v $: $Revision: 1.7 $\n";