Ignore:
Timestamp:
Feb 29, 2008, 1:58:46 AM (13 years ago)
Author:
charles
Message:

fix r5164 thread timing issue reported by pea_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r5167 r5171  
    142142{
    143143    tr_thread * t = tr_new0( tr_thread, 1 );
    144 
    145 #ifdef __BEOS__
    146     t->thread = spawn_thread( (void*)ThreadFunc, name, B_NORMAL_PRIORITY, t );
    147     resume_thread( t->thread );
    148 #elif defined(WIN32)
    149     unsigned id;
    150     t->thread_handle = (HANDLE) _beginthreadex( NULL, 0, &ThreadFunc, t, 0, &id );
    151     t->thread = (DWORD) id;
    152 #else
    153     pthread_create( &t->thread, NULL, (void * (*) (void *)) ThreadFunc, t );
    154 #endif
    155144    t->func = func;
    156145    t->arg  = arg;
    157146    t->name = name;
     147
     148#ifdef __BEOS__
     149    t->thread = spawn_thread( (void*)ThreadFunc, name, B_NORMAL_PRIORITY, t );
     150    resume_thread( t->thread );
     151#elif defined(WIN32)
     152    {
     153        unsigned int id;
     154        t->thread_handle = (HANDLE) _beginthreadex( NULL, 0, &ThreadFunc, t, 0, &id );
     155        t->thread = (DWORD) id;
     156    }
     157#else
     158    pthread_create( &t->thread, NULL, (void * (*) (void *)) ThreadFunc, t );
     159#endif
    158160
    159161    return t;
Note: See TracChangeset for help on using the changeset viewer.