File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -765,11 +765,12 @@ func go_schedule_opcache_reset(threadIndex C.uintptr_t) C.bool {
765765 return C .bool (true )
766766 }
767767
768+ // always call the original opcache_reset if already restarting
768769 return C .bool (phpThreads [threadIndex ].state .Is (state .Restarting ))
769770}
770771
771772// restart all threads for an opcache_reset
772- func restartThreadsForOpcacheReset (exceptThisThread * phpThread ) {
773+ func restartThreadsForOpcacheReset (callingThread * phpThread ) {
773774 if threadsAreRestarting .Load () {
774775 // ignore reloads while a restart is already ongoing
775776 return
@@ -792,16 +793,13 @@ func restartThreadsForOpcacheReset(exceptThisThread *phpThread) {
792793 thread .state .Set (state .Restarting )
793794 close (thread .drainChan )
794795
795- if thread == exceptThisThread {
796- continue
797- }
798-
799796 wg .Go (func () {
800797 thread .state .WaitFor (state .Yielding )
801798 })
802799 }
803800 }
804801
802+ wg .Done () // ignore the calling thread
805803 done := make (chan struct {})
806804 go func () {
807805 wg .Wait ()
@@ -816,7 +814,7 @@ func restartThreadsForOpcacheReset(exceptThisThread *phpThread) {
816814 }
817815
818816 go func () {
819- exceptThisThread .state .WaitFor (state .Yielding )
817+ callingThread .state .WaitFor (state .Yielding )
820818 for _ , thread := range threadsToRestart {
821819 thread .drainChan = make (chan struct {})
822820 thread .state .Set (state .Ready )
You can’t perform that action at this time.
0 commit comments