return lock;
}
-static void workerFunc( void * user_data )
+static void makeMetaWorkerFunc( void * user_data )
{
tr_handle * handle = (tr_handle *) user_data;
builder->nextBuilder = queue;
queue = builder;
if( !workerThread )
- workerThread = tr_threadNew( workerFunc, builder->handle, "makeMeta" );
+ workerThread = tr_threadNew( makeMetaWorkerFunc, builder->handle );
tr_lockUnlock( lock );
}
{
void (* func ) ( void * );
void * arg;
- const char * name;
tr_thread_id thread;
#ifdef WIN32
HANDLE thread_handle;
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,
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 );
}
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)
{
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 );
eh->lock = tr_lockNew( );
pipe( eh->fds );
eh->h = handle;
- eh->thread = tr_threadNew( libeventThreadFunc, eh, "libeventThreadFunc" );
+ eh->thread = tr_threadNew( libeventThreadFunc, eh );
}
void
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( ) );
}
}