@@ -112,7 +112,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
112
112
#elif defined(TSRM_WIN32 )
113
113
tls_key = TlsAlloc ();
114
114
#elif defined(BETHREADS )
115
- tls_key = tls_allocate ();
115
+ tls_key = tls_allocate ();
116
116
#endif
117
117
118
118
tsrm_error_file = stderr ;
@@ -262,7 +262,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
262
262
#elif defined(TSRM_WIN32 )
263
263
TlsSetValue (tls_key , (void * ) * thread_resources_ptr );
264
264
#elif defined(BETHREADS )
265
- tls_set (tls_key , (void * ) * thread_resources_ptr );
265
+ tls_set (tls_key , (void * ) * thread_resources_ptr );
266
266
#endif
267
267
268
268
if (tsrm_new_thread_begin_handler ) {
@@ -303,7 +303,7 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
303
303
#elif defined(TSRM_WIN32 )
304
304
thread_resources = TlsGetValue (tls_key );
305
305
#elif defined(BETHREADS )
306
- thread_resources = (tsrm_tls_entry * )tls_get (tls_key );
306
+ thread_resources = (tsrm_tls_entry * )tls_get (tls_key );
307
307
#else
308
308
thread_resources = NULL ;
309
309
#endif
@@ -439,18 +439,18 @@ TSRM_API THREAD_T tsrm_thread_id(void)
439
439
/* Allocate a mutex */
440
440
TSRM_API MUTEX_T tsrm_mutex_alloc (void )
441
441
{
442
- MUTEX_T mutexp ;
442
+ MUTEX_T mutexp ;
443
443
#ifdef NETWARE
444
- long flags = 0 ; /* Don't require NX_MUTEX_RECURSIVE, I guess */
445
- NXHierarchy_t order = 0 ;
446
- NX_LOCK_INFO_ALLOC (lockInfo , "PHP-TSRM" , 0 );
444
+ long flags = 0 ; /* Don't require NX_MUTEX_RECURSIVE, I guess */
445
+ NXHierarchy_t order = 0 ;
446
+ NX_LOCK_INFO_ALLOC (lockInfo , "PHP-TSRM" , 0 );
447
447
#endif
448
448
449
449
#ifdef TSRM_WIN32
450
- mutexp = malloc (sizeof (CRITICAL_SECTION ));
450
+ mutexp = malloc (sizeof (CRITICAL_SECTION ));
451
451
InitializeCriticalSection (mutexp );
452
452
#elif defined(NETWARE )
453
- mutexp = NXMutexAlloc (flags , order , & lockInfo ); /* return value ignored for now */
453
+ mutexp = NXMutexAlloc (flags , order , & lockInfo ); /* return value ignored for now */
454
454
#elif defined(GNUPTH )
455
455
mutexp = (MUTEX_T ) malloc (sizeof (* mutexp ));
456
456
pth_mutex_init (mutexp );
@@ -469,16 +469,16 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
469
469
mutexp -> sem = create_sem (1 , "PHP sempahore" );
470
470
#endif
471
471
#ifdef THR_DEBUG
472
- printf ("Mutex created thread: %d\n" ,mythreadid ());
472
+ printf ("Mutex created thread: %d\n" ,mythreadid ());
473
473
#endif
474
- return ( mutexp );
474
+ return ( mutexp );
475
475
}
476
476
477
477
478
478
/* Free a mutex */
479
479
TSRM_API void tsrm_mutex_free (MUTEX_T mutexp )
480
480
{
481
- if (mutexp ) {
481
+ if (mutexp ) {
482
482
#ifdef TSRM_WIN32
483
483
DeleteCriticalSection (mutexp );
484
484
#elif defined(NETWARE )
@@ -498,9 +498,9 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
498
498
delete_sem (mutexp -> sem );
499
499
free (mutexp );
500
500
#endif
501
- }
501
+ }
502
502
#ifdef THR_DEBUG
503
- printf ("Mutex freed thread: %d\n" ,mythreadid ());
503
+ printf ("Mutex freed thread: %d\n" ,mythreadid ());
504
504
#endif
505
505
}
506
506
@@ -513,7 +513,7 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
513
513
EnterCriticalSection (mutexp );
514
514
return 1 ;
515
515
#elif defined(NETWARE )
516
- return NXLock (mutexp );
516
+ return NXLock (mutexp );
517
517
#elif defined(GNUPTH )
518
518
return pth_mutex_acquire (mutexp , 0 , NULL );
519
519
#elif defined(PTHREADS )
@@ -526,8 +526,8 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
526
526
return st_mutex_lock (mutexp );
527
527
#elif defined(BETHREADS )
528
528
if (atomic_add (& mutexp -> ben , 1 ) != 0 )
529
- return acquire_sem (mutexp -> sem );
530
- return 0 ;
529
+ return acquire_sem (mutexp -> sem );
530
+ return 0 ;
531
531
#endif
532
532
}
533
533
@@ -552,8 +552,8 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
552
552
#elif defined(TSRM_ST )
553
553
return st_mutex_unlock (mutexp );
554
554
#elif defined(BETHREADS )
555
- if (atomic_add (& mutexp -> ben , -1 ) != 1 )
556
- return release_sem (mutexp -> sem );
555
+ if (atomic_add (& mutexp -> ben , -1 ) != 1 )
556
+ return release_sem (mutexp -> sem );
557
557
return 0 ;
558
558
#endif
559
559
}
0 commit comments