File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,12 @@ extern zend_module_entry parallel_module_entry;
3030ZEND_TSRMLS_CACHE_EXTERN ()
3131# endif
3232
33- #endif /* PHP_PARALLEL_H */
33+ #if _WIN32
34+ # define PARALLEL_API __declspec(dllexport)
35+ #else
36+ # define PARALLEL_API __attribute__ ((visibility("default")))
37+ #endif
38+
39+ PARALLEL_API bool php_parallel_is_parallel_worker_thread (void );
3440
41+ #endif /* PHP_PARALLEL_H */
Original file line number Diff line number Diff line change 1919#define HAVE_PARALLEL_SCHEDULER
2020
2121#include "parallel.h"
22+ #include "../php_parallel.h"
2223#include "zend_types.h"
2324
2425TSRM_TLS php_parallel_runtime_t * php_parallel_scheduler_context = NULL ;
@@ -179,7 +180,7 @@ static zend_always_inline void php_parallel_scheduler_add(
179180 }
180181}
181182
182- static zend_always_inline zend_bool php_parallel_scheduler_empty (php_parallel_runtime_t * runtime ) {
183+ static zend_always_inline bool php_parallel_scheduler_empty (php_parallel_runtime_t * runtime ) {
183184 return !zend_llist_count (& runtime -> schedule );
184185}
185186
@@ -683,6 +684,10 @@ zend_bool php_parallel_scheduler_cancel(php_parallel_future_t *future) {
683684 }
684685}
685686
687+ PARALLEL_API bool php_parallel_is_parallel_worker_thread (void ) {
688+ return php_parallel_scheduler_context != NULL ;
689+ }
690+
686691static void php_parallel_scheduler_interrupt (zend_execute_data * execute_data ) {
687692 if (php_parallel_scheduler_context ) {
688693 php_parallel_monitor_lock (php_parallel_scheduler_context -> monitor );
You can’t perform that action at this time.
0 commit comments