1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 06:02:57 +00:00

readability tweak: remove thread names. (muks)

This commit is contained in:
Charles Kerr 2008-08-12 14:03:03 +00:00
parent 02448556f9
commit fb6db8d5ef
5 changed files with 7 additions and 14 deletions

View 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 );
}

View 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)
{

View 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 );

View 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

View 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( ) );
}
}