]> granicus.if.org Git - transmission/commitdiff
readability tweak: remove thread names. (muks)
authorCharles Kerr <charles@transmissionbt.com>
Tue, 12 Aug 2008 14:03:03 +0000 (14:03 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 12 Aug 2008 14:03:03 +0000 (14:03 +0000)
libtransmission/makemeta.c
libtransmission/platform.c
libtransmission/platform.h
libtransmission/trevent.c
libtransmission/verify.c

index fa59742c4861eea844706bcd9b9b60451b2ee562..f37cfd967748af2e2269ad34c0df893724de8303 100644 (file)
@@ -425,7 +425,7 @@ static tr_lock* getQueueLock( tr_handle * h )
     return lock;
 }
 
-static void workerFunc( void * user_data )
+static void makeMetaWorkerFunc( void * user_data )
 {
     tr_handle * handle = (tr_handle *) user_data;
 
@@ -495,7 +495,7 @@ tr_makeMetaInfo( tr_metainfo_builder    * builder,
     builder->nextBuilder = queue;
     queue = builder;
     if( !workerThread )
-         workerThread = tr_threadNew( workerFunc, builder->handle, "makeMeta" );
+         workerThread = tr_threadNew( makeMetaWorkerFunc, builder->handle );
     tr_lockUnlock( lock );
 }
 
index 515f1e96e07441de5af90a088cd3fe964f4dc8bb..4e271306a6af07fc703297869a701ad146a20d68 100644 (file)
@@ -87,7 +87,6 @@ struct tr_thread
 {
     void          (* func ) ( void * );
     void           * arg;
-    const char     * name;
     tr_thread_id     thread;
 #ifdef WIN32
     HANDLE           thread_handle;
@@ -110,7 +109,6 @@ static ThreadFuncReturnType
 ThreadFunc( void * _t )
 {
     tr_thread * t = _t;
-    const char * name = t->name;
 
 #ifdef __BEOS__
     /* This is required because on BeOS, SIGINT is sent to each thread,
@@ -118,9 +116,7 @@ ThreadFunc( void * _t )
     signal( SIGINT, SIG_IGN );
 #endif
 
-    tr_dbg( "Thread '%s' started", name );
     t->func( t->arg );
-    tr_dbg( "Thread '%s' exited", name );
 
 #ifdef WIN32
     _endthreadex( 0 );
@@ -129,17 +125,14 @@ ThreadFunc( void * _t )
 }
 
 tr_thread *
-tr_threadNew( void (*func)(void *),
-              void * arg,
-              const char * name )
+tr_threadNew( void (*func)(void *), void * arg )
 {
     tr_thread * t = tr_new0( tr_thread, 1 );
     t->func = func;
     t->arg  = arg;
-    t->name = name;
 
 #ifdef __BEOS__
-    t->thread = spawn_thread( (void*)ThreadFunc, name, B_NORMAL_PRIORITY, t );
+    t->thread = spawn_thread( (void*)ThreadFunc, "beos thread", B_NORMAL_PRIORITY, t );
     resume_thread( t->thread );
 #elif defined(WIN32)
     {
index 5e4ae9cd34505fe13a6a6c31cb7053d7d1f2dc6c..14bd897d18bcc63c5c55ac9bc970aeb5bb49c1ef 100644 (file)
@@ -47,7 +47,7 @@ const char * tr_getTorrentDir ( const struct tr_handle * );
 const char * tr_getClutchDir  ( const struct tr_handle * );
 
 
-tr_thread*   tr_threadNew  ( void (*func)(void *), void * arg, const char * name );
+tr_thread*   tr_threadNew  ( void (*func)(void *), void * arg );
 int          tr_amInThread ( const tr_thread * );
 
 tr_lock *    tr_lockNew        ( void );
index 0851d586a900a3d14e035601fd0586a09ec5545b..3ca3c6ddcd37228a4a7831a643e326c2d9fb3dfc 100644 (file)
@@ -167,7 +167,7 @@ tr_eventInit( tr_handle * handle )
     eh->lock = tr_lockNew( );
     pipe( eh->fds );
     eh->h = handle;
-    eh->thread = tr_threadNew( libeventThreadFunc, eh, "libeventThreadFunc" );
+    eh->thread = tr_threadNew( libeventThreadFunc, eh );
 }
 
 void
index 95516b1ad3d40f79d1da9c1c66312c039857afd2..3bcb09ced7a6fed54b61c87f19be5a19c2a264f1 100644 (file)
@@ -177,7 +177,7 @@ tr_verifyAdd( tr_torrent          * tor,
         tor->verifyState = verifyList ? TR_VERIFY_WAIT : TR_VERIFY_NOW;
         tr_list_append( &verifyList, node );
         if( verifyThread == NULL )
-            verifyThread = tr_threadNew( verifyThreadFunc, NULL, "verifyThreadFunc" );
+            verifyThread = tr_threadNew( verifyThreadFunc, NULL );
         tr_lockUnlock( getVerifyLock( ) );
     }
 }