Changeset 4042 for trunk/libtransmission/platform.c
- Timestamp:
- Dec 2, 2007, 6:20:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r4041 r4042 242 242 tr_lockLock( tr_lock * l ) 243 243 { 244 const tr_thread_id currentThread = tr_getCurrentThread( );245 246 244 #ifdef __BEOS__ 247 245 acquire_sem( l->lock ); … … 251 249 pthread_mutex_lock( &l->lock ); 252 250 #endif 253 l->lockThread = currentThread;251 l->lockThread = tr_getCurrentThread( ); 254 252 ++l->depth; 253 /* fprintf( stderr, "thread %lu acquired lock %p... depth is now %d\n", (unsigned long)l->lockThread, l, l->depth ); */ 255 254 assert( l->depth >= 1 ); 256 255 } … … 266 265 tr_lockUnlock( tr_lock * l ) 267 266 { 267 /* fprintf( stderr, "thread %lu releasing lock %p... depth before release is %d\n", (unsigned long)l->lockThread, l, l->depth ); */ 268 268 269 assert( l->depth > 0 ); 269 270 assert( tr_areThreadsEqual( l->lockThread, tr_getCurrentThread() )); 270 271 assert( tr_lockHave( l ) ); 271 272 272 #ifdef __BEOS__273 release_sem( l->lock );274 #elif defined(WIN32)275 LeaveCriticalSection( &l->lock );276 #else277 pthread_mutex_unlock( &l->lock );278 #endif279 273 --l->depth; 280 274 assert( l->depth >= 0 ); 275 #ifdef __BEOS__ 276 release_sem( l->lock ); 277 #elif defined(WIN32) 278 LeaveCriticalSection( &l->lock ); 279 #else 280 pthread_mutex_unlock( &l->lock ); 281 #endif 281 282 } 282 283
Note: See TracChangeset
for help on using the changeset viewer.