File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 19
19
static zend_op_array dummy_op_array ;
20
20
static zend_jit_trace_info * zend_jit_traces = NULL ;
21
21
static const void * * zend_jit_exit_groups = NULL ;
22
+ static zend_atomic_bool jit_counters_stopped ;
22
23
23
24
#define ZEND_JIT_COUNTER_NUM zend_jit_traces[0].root
24
25
#define ZEND_JIT_TRACE_NUM zend_jit_traces[0].id
@@ -63,6 +64,7 @@ static int zend_jit_trace_startup(zend_bool reattached)
63
64
ZEND_JIT_EXIT_COUNTERS = 0 ;
64
65
ZCSG (jit_traces ) = zend_jit_traces ;
65
66
ZCSG (jit_exit_groups ) = zend_jit_exit_groups ;
67
+ ZEND_ATOMIC_BOOL_INIT (& jit_counters_stopped , false);
66
68
} else {
67
69
zend_jit_traces = ZCSG (jit_traces );
68
70
if (!zend_jit_traces ) {
@@ -7242,6 +7244,10 @@ static void zend_jit_stop_persistent_script(zend_persistent_script *script)
7242
7244
/* Get all scripts which are accelerated by JIT */
7243
7245
static void zend_jit_stop_counter_handlers (void )
7244
7246
{
7247
+ if (zend_atomic_bool_exchange_ex (& jit_counters_stopped , true)) {
7248
+ return ;
7249
+ }
7250
+
7245
7251
zend_shared_alloc_lock ();
7246
7252
/* mprotect has an extreme overhead, avoid calls to it for every function. */
7247
7253
SHM_UNPROTECT ();
You can’t perform that action at this time.
0 commit comments