@@ -444,7 +444,7 @@ static void lsapi_close_connection(LSAPI_Request *pReq)
444
444
if (s_busy_workers )
445
445
__sync_fetch_and_sub (s_busy_workers , 1 );
446
446
if (s_worker_status )
447
- __sync_lock_test_and_set (& s_worker_status -> m_state , LSAPI_STATE_IDLE );
447
+ __atomic_test_and_set (& s_worker_status -> m_state , LSAPI_STATE_IDLE );
448
448
}
449
449
450
450
@@ -1588,7 +1588,7 @@ int LSAPI_Accept_r( LSAPI_Request * pReq )
1588
1588
else
1589
1589
{
1590
1590
if (s_worker_status )
1591
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
1591
+ __atomic_test_and_set (& s_worker_status -> m_state ,
1592
1592
LSAPI_STATE_CONNECTED );
1593
1593
if (s_busy_workers )
1594
1594
__sync_fetch_and_add (s_busy_workers , 1 );
@@ -3316,7 +3316,7 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
3316
3316
if (pthread_atfork_func )
3317
3317
(* pthread_atfork_func )(NULL , NULL , set_skip_write );
3318
3318
3319
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
3319
+ __atomic_test_and_set (& s_worker_status -> m_state ,
3320
3320
LSAPI_STATE_CONNECTED );
3321
3321
if (s_busy_workers )
3322
3322
__sync_add_and_fetch (s_busy_workers , 1 );
@@ -3391,7 +3391,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq)
3391
3391
{
3392
3392
int max_children = g_prefork_server -> m_iMaxChildren ;
3393
3393
s_pid = getpid ();
3394
- __sync_lock_test_and_set (& pReq -> child_status -> m_pid , s_pid );
3394
+ __atomic_test_and_set (& pReq -> child_status -> m_pid , s_pid );
3395
3395
s_worker_status = pReq -> child_status ;
3396
3396
3397
3397
setsid ();
@@ -3403,7 +3403,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq)
3403
3403
if (pthread_atfork_func )
3404
3404
(* pthread_atfork_func )(NULL , NULL , set_skip_write );
3405
3405
3406
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
3406
+ __atomic_test_and_set (& s_worker_status -> m_state ,
3407
3407
LSAPI_STATE_CONNECTED );
3408
3408
if (s_busy_workers )
3409
3409
__sync_add_and_fetch (s_busy_workers , 1 );
@@ -3652,7 +3652,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
3652
3652
if (fd == pReq -> m_fdListen )
3653
3653
{
3654
3654
if (s_worker_status )
3655
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
3655
+ __atomic_test_and_set (& s_worker_status -> m_state ,
3656
3656
LSAPI_STATE_ACCEPTING );
3657
3657
if (s_accepting_workers )
3658
3658
__sync_fetch_and_add (s_accepting_workers , 1 );
@@ -3663,7 +3663,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
3663
3663
if (s_accepting_workers )
3664
3664
__sync_fetch_and_sub (s_accepting_workers , 1 );
3665
3665
if (s_worker_status )
3666
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
3666
+ __atomic_test_and_set (& s_worker_status -> m_state ,
3667
3667
LSAPI_STATE_IDLE );
3668
3668
}
3669
3669
@@ -3712,7 +3712,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
3712
3712
if ( pReq -> m_fd != -1 )
3713
3713
{
3714
3714
if (s_worker_status )
3715
- __sync_lock_test_and_set (& s_worker_status -> m_state ,
3715
+ __atomic_test_and_set (& s_worker_status -> m_state ,
3716
3716
LSAPI_STATE_CONNECTED );
3717
3717
if (s_busy_workers )
3718
3718
__sync_fetch_and_add (s_busy_workers , 1 );
0 commit comments