Changeset 293688 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- May 2, 2022, 3:33:52 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r293588 r293688 96 96 #include <wtf/WallTime.h> 97 97 #include <wtf/text/StringBuilder.h> 98 #include <wtf/threads/BinarySemaphore.h> 98 99 #include <wtf/threads/Signals.h> 99 100 … … 3036 3037 #endif 3037 3038 3039 #if OS(UNIX) 3040 BinarySemaphore waitToExit; 3041 3042 if (getenv("JS_SHELL_WAIT_FOR_SIGUSR2_TO_EXIT")) { 3043 addSignalHandler(Signal::Usr, SignalHandler([&] (Signal, SigInfo&, PlatformRegisters&) { 3044 dataLogLn("Signal handler hit, we can exit now."); 3045 waitToExit.signal(); 3046 return SignalAction::Handled; 3047 })); 3048 activateSignalHandlersFor(Signal::Usr); 3049 } 3050 #endif 3051 3038 3052 // We can't use destructors in the following code because it uses Windows 3039 3053 // Structured Exception Handling … … 3049 3063 getc(stdin); 3050 3064 } 3065 3066 #if OS(UNIX) 3067 if (getenv("JS_SHELL_WAIT_FOR_SIGUSR2_TO_EXIT")) { 3068 WTF::fastDisableScavenger(); 3069 fprintf(stdout, "\njs shell waiting for `kill -USR2 [pid]` to exit\n"); 3070 fflush(stdout); 3071 3072 waitToExit.wait(); 3073 3074 fprintf(stdout, "\njs shell exiting\n"); 3075 fflush(stdout); 3076 } 3077 #endif 3051 3078 3052 3079 jscExit(res);
Note:
See TracChangeset
for help on using the changeset viewer.