From fb6db8d5efca11ccbdb06aba37810e7ab1bb0a6e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 12 Aug 2008 14:03:03 +0000 Subject: [PATCH] readability tweak: remove thread names. (muks) --- libtransmission/makemeta.c | 4 ++-- libtransmission/platform.c | 11 ++--------- libtransmission/platform.h | 2 +- libtransmission/trevent.c | 2 +- libtransmission/verify.c | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index fa59742c4..f37cfd967 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -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 ); } diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 515f1e96e..4e271306a 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -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) { diff --git a/libtransmission/platform.h b/libtransmission/platform.h index 5e4ae9cd3..14bd897d1 100644 --- a/libtransmission/platform.h +++ b/libtransmission/platform.h @@ -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 ); diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index 0851d586a..3ca3c6ddc 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -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 diff --git a/libtransmission/verify.c b/libtransmission/verify.c index 95516b1ad..3bcb09ced 100644 --- a/libtransmission/verify.c +++ b/libtransmission/verify.c @@ -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( ) ); } }