diff options
author | davidovski <david@davidovski.xyz> | 2023-02-02 14:10:02 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-02-02 14:10:02 +0000 |
commit | f29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (patch) | |
tree | 76fe6267f8307e7630fc6f53ff99a9767ad40de0 /skip/php8/atomic-lsapi.patch | |
parent | 05d004dfe0c9a9d898fac8a4a0292ca2a74ca391 (diff) |
Work
Diffstat (limited to 'skip/php8/atomic-lsapi.patch')
-rw-r--r-- | skip/php8/atomic-lsapi.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/skip/php8/atomic-lsapi.patch b/skip/php8/atomic-lsapi.patch new file mode 100644 index 0000000..39cf182 --- /dev/null +++ b/skip/php8/atomic-lsapi.patch @@ -0,0 +1,82 @@ +Patch-Source: https://github.com/php/php-src/pull/7997 + +diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c +index 2208bbd47b..42dd320356 100644 +--- a/sapi/litespeed/lsapilib.c ++++ b/sapi/litespeed/lsapilib.c +@@ -443,7 +443,7 @@ static void lsapi_close_connection(LSAPI_Request *pReq) + if (s_busy_workers) + __sync_fetch_and_sub(s_busy_workers, 1); + if (s_worker_status) +- __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE); ++ __atomic_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE); + } + + +@@ -1587,7 +1587,7 @@ int LSAPI_Accept_r( LSAPI_Request * pReq ) + else + { + if (s_worker_status) +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_CONNECTED); + if (s_busy_workers) + __sync_fetch_and_add(s_busy_workers, 1); +@@ -3315,7 +3315,7 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, + if (pthread_atfork_func) + (*pthread_atfork_func)(NULL, NULL, set_skip_write); + +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_CONNECTED); + if (s_busy_workers) + __sync_add_and_fetch(s_busy_workers, 1); +@@ -3402,7 +3402,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq) + if (pthread_atfork_func) + (*pthread_atfork_func)(NULL, NULL, set_skip_write); + +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_CONNECTED); + if (s_busy_workers) + __sync_add_and_fetch(s_busy_workers, 1); +@@ -3651,7 +3651,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) + if (fd == pReq->m_fdListen) + { + if (s_worker_status) +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_ACCEPTING); + if (s_accepting_workers) + __sync_fetch_and_add(s_accepting_workers, 1); +@@ -3662,7 +3662,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) + if (s_accepting_workers) + __sync_fetch_and_sub(s_accepting_workers, 1); + if (s_worker_status) +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_IDLE); + } + +@@ -3711,7 +3711,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) + if ( pReq->m_fd != -1 ) + { + if (s_worker_status) +- __sync_lock_test_and_set(&s_worker_status->m_state, ++ __atomic_test_and_set(&s_worker_status->m_state, + LSAPI_STATE_CONNECTED); + if (s_busy_workers) + __sync_fetch_and_add(s_busy_workers, 1); +diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c +index 42dd320356..0932ebaaa8 100644 +--- a/sapi/litespeed/lsapilib.c ++++ b/sapi/litespeed/lsapilib.c +@@ -3390,7 +3390,7 @@ int LSAPI_Postfork_Child(LSAPI_Request * pReq) + { + int max_children = g_prefork_server->m_iMaxChildren; + s_pid = getpid(); +- __sync_lock_test_and_set(&pReq->child_status->m_pid, s_pid); ++ __atomic_test_and_set(&pReq->child_status->m_pid, s_pid); + s_worker_status = pReq->child_status; + + setsid(); |