File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -954,36 +954,7 @@ extern (C) void thread_suspendAll() nothrow
954954 t = tn;
955955 }
956956
957- version (Darwin)
958- {}
959- else version (Solaris )
960- {}
961- else version (WASI )
962- {}
963- else version (Posix )
964- {
965- // Subtract own thread if we called suspend() on ourselves.
966- // For example, suspendedSelf would be false if the current
967- // thread ran thread_detachThis().
968- assert (cnt >= 1 );
969- if (suspendedSelf)
970- -- cnt;
971- // wait for semaphore notifications
972- for (; cnt; -- cnt)
973- {
974- while (sem_wait(&suspendCount) != 0 )
975- {
976- if (errno != EINTR )
977- onThreadError(" Unable to wait for semaphore" );
978- errno = 0 ;
979- }
980- }
981- }
982- else version (Windows )
983- {
984- }
985- else
986- static assert (0 , " unsupported os" );
957+ afterStopTheWorld(suspendedSelf, cnt);
987958 }
988959}
989960
Original file line number Diff line number Diff line change @@ -864,6 +864,35 @@ package bool resumeThreadImpl(Thread t) @nogc nothrow
864864 return pthread_kill (t.m_tdescr.tid, resumeSignalNumber) == 0 ;
865865}
866866
867+ package void afterStopTheWorld(bool suspendedSelf, size_t cnt) @nogc nothrow
868+ {
869+ version (Darwin)
870+ {}
871+ else version (Solaris )
872+ {}
873+ else version (WASI )
874+ {}
875+ else version (Posix )
876+ {
877+ // Subtract own thread if we called suspend() on ourselves.
878+ // For example, suspendedSelf would be false if the current
879+ // thread ran thread_detachThis().
880+ assert (cnt >= 1 );
881+ if (suspendedSelf)
882+ -- cnt;
883+ // wait for semaphore notifications
884+ for (; cnt; -- cnt)
885+ {
886+ while (sem_wait(&suspendCount) != 0 )
887+ {
888+ if (errno != EINTR )
889+ onThreadError(" Unable to wait for semaphore" );
890+ errno = 0 ;
891+ }
892+ }
893+ }
894+ }
895+
867896package void loadStackAndRegInfo(Thread t, const bool sameThread) nothrow @nogc
868897{
869898 version (Darwin)
Original file line number Diff line number Diff line change @@ -462,6 +462,8 @@ package bool resumeThreadImpl(Thread t) @nogc nothrow
462462 return ResumeThread (t.m_tdescr.hndl) != 0xFFFFFFFF ;
463463}
464464
465+ package void afterStopTheWorld(bool suspendedSelf, size_t cnt) @nogc nothrow { /* do nothing */ }
466+
465467package void loadStackAndRegInfo(Thread t, const bool sameThread) nothrow @nogc
466468{
467469 CONTEXT context = void ;
You can’t perform that action at this time.
0 commit comments