@@ -55,7 +55,7 @@ impl ExecutorGlobals {
5555
5656 cfg_if:: cfg_if! {
5757 if #[ cfg( php_zts) ] {
58- let guard = lock:: GLOBALS_LOCK . with( |l| l . read_arc( ) ) ;
58+ let guard = lock:: GLOBALS_LOCK . with( RwLock :: read_arc) ;
5959 } else {
6060 let guard = lock:: GLOBALS_LOCK . read_arc( ) ;
6161 }
@@ -83,7 +83,7 @@ impl ExecutorGlobals {
8383
8484 cfg_if:: cfg_if! {
8585 if #[ cfg( php_zts) ] {
86- let guard = lock:: GLOBALS_LOCK . with( |l| l . write_arc( ) ) ;
86+ let guard = lock:: GLOBALS_LOCK . with( RwLock :: write_arc) ;
8787 } else {
8888 let guard = lock:: GLOBALS_LOCK . write_arc( ) ;
8989 }
@@ -201,7 +201,7 @@ impl ExecutorGlobals {
201201 cfg_if:: cfg_if! {
202202 if #[ cfg( php82) ] {
203203 unsafe {
204- zend_atomic_bool_store( & mut self . vm_interrupt, true ) ;
204+ zend_atomic_bool_store( & raw mut self . vm_interrupt, true ) ;
205205 }
206206 } else {
207207 self . vm_interrupt = true ;
@@ -214,7 +214,7 @@ impl ExecutorGlobals {
214214 cfg_if:: cfg_if! {
215215 if #[ cfg( php82) ] {
216216 unsafe {
217- zend_atomic_bool_store( & mut self . vm_interrupt, false ) ;
217+ zend_atomic_bool_store( & raw mut self . vm_interrupt, false ) ;
218218 }
219219 } else {
220220 self . vm_interrupt = true ;
@@ -245,7 +245,7 @@ impl CompilerGlobals {
245245
246246 cfg_if:: cfg_if! {
247247 if #[ cfg( php_zts) ] {
248- let guard = lock:: GLOBALS_LOCK . with( |l| l . read_arc( ) ) ;
248+ let guard = lock:: GLOBALS_LOCK . with( RwLock :: read_arc) ;
249249 } else {
250250 let guard = lock:: GLOBALS_LOCK . read_arc( ) ;
251251 }
@@ -273,7 +273,7 @@ impl CompilerGlobals {
273273
274274 cfg_if:: cfg_if! {
275275 if #[ cfg( php_zts) ] {
276- let guard = lock:: GLOBALS_LOCK . with( |l| l . write_arc( ) ) ;
276+ let guard = lock:: GLOBALS_LOCK . with( RwLock :: write_arc) ;
277277 } else {
278278 let guard = lock:: GLOBALS_LOCK . write_arc( ) ;
279279 }
@@ -346,7 +346,7 @@ impl ProcessGlobals {
346346
347347 cfg_if:: cfg_if! {
348348 if #[ cfg( php_zts) ] {
349- let guard = lock:: PROCESS_GLOBALS_LOCK . with( |l| l . read_arc( ) ) ;
349+ let guard = lock:: PROCESS_GLOBALS_LOCK . with( RwLock :: read_arc) ;
350350 } else {
351351 let guard = lock:: PROCESS_GLOBALS_LOCK . read_arc( ) ;
352352 }
@@ -369,7 +369,7 @@ impl ProcessGlobals {
369369
370370 cfg_if:: cfg_if! {
371371 if #[ cfg( php_zts) ] {
372- let guard = lock:: PROCESS_GLOBALS_LOCK . with( |l| l . write_arc( ) ) ;
372+ let guard = lock:: PROCESS_GLOBALS_LOCK . with( RwLock :: write_arc) ;
373373 } else {
374374 let guard = lock:: PROCESS_GLOBALS_LOCK . write_arc( ) ;
375375 }
@@ -506,14 +506,15 @@ impl SapiGlobals {
506506 /// Attempting to retrieve the globals while already holding the global
507507 /// guard will lead to a deadlock. Dropping the globals guard will release
508508 /// the lock.
509+ #[ must_use]
509510 pub fn get ( ) -> GlobalReadGuard < Self > {
510511 // SAFETY: PHP executor globals are statically declared therefore should never
511512 // return an invalid pointer.
512513 let globals = unsafe { & * ext_php_rs_sapi_globals ( ) } ;
513514
514515 cfg_if:: cfg_if! {
515516 if #[ cfg( php_zts) ] {
516- let guard = lock:: SAPI_GLOBALS_LOCK . with( |l| l . read_arc( ) ) ;
517+ let guard = lock:: SAPI_GLOBALS_LOCK . with( RwLock :: read_arc) ;
517518 } else {
518519 let guard = lock:: SAPI_GLOBALS_LOCK . read_arc( ) ;
519520 }
@@ -536,7 +537,7 @@ impl SapiGlobals {
536537
537538 cfg_if:: cfg_if! {
538539 if #[ cfg( php_zts) ] {
539- let guard = lock:: SAPI_GLOBALS_LOCK . with( |l| l . write_arc( ) ) ;
540+ let guard = lock:: SAPI_GLOBALS_LOCK . with( RwLock :: write_arc) ;
540541 } else {
541542 let guard = lock:: SAPI_GLOBALS_LOCK . write_arc( ) ;
542543 }
@@ -777,7 +778,7 @@ impl FileGlobals {
777778
778779 cfg_if:: cfg_if! {
779780 if #[ cfg( php_zts) ] {
780- let guard = lock:: FILE_GLOBALS_LOCK . with( |l| l . read_arc( ) ) ;
781+ let guard = lock:: FILE_GLOBALS_LOCK . with( RwLock :: read_arc) ;
781782 } else {
782783 let guard = lock:: FILE_GLOBALS_LOCK . read_arc( ) ;
783784 }
@@ -793,14 +794,15 @@ impl FileGlobals {
793794 /// Attempting to retrieve the globals while already holding the global
794795 /// guard will lead to a deadlock. Dropping the globals guard will release
795796 /// the lock.
797+ #[ must_use]
796798 pub fn get_mut ( ) -> GlobalWriteGuard < Self > {
797799 // SAFETY: PHP executor globals are statically declared therefore should never
798800 // return an invalid pointer.
799801 let globals = unsafe { & mut * ext_php_rs_file_globals ( ) } ;
800802
801803 cfg_if:: cfg_if! {
802804 if #[ cfg( php_zts) ] {
803- let guard = lock:: FILE_GLOBALS_LOCK . with( |l| l . write_arc( ) ) ;
805+ let guard = lock:: FILE_GLOBALS_LOCK . with( RwLock :: write_arc) ;
804806 } else {
805807 let guard = lock:: FILE_GLOBALS_LOCK . write_arc( ) ;
806808 }
0 commit comments