File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/runtime/builtin_modules Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,12 @@ Box* getIdent() {
198198 return boxInt (pthread_self ());
199199}
200200
201+ Box* interruptMain () {
202+ PyErr_SetInterrupt ();
203+ Py_INCREF (Py_None);
204+ return Py_None;
205+ }
206+
201207Box* stackSize () {
202208 Py_FatalError (" unimplemented" );
203209}
@@ -227,6 +233,9 @@ void setupThread() {
227233 FunctionMetadata::create ((void *)getIdent, BOXED_INT, 0 ), " get_ident" ));
228234 thread_module->giveAttr (" stack_size" , new BoxedBuiltinFunctionOrMethod (
229235 FunctionMetadata::create ((void *)stackSize, BOXED_INT, 0 ), " stack_size" ));
236+ thread_module->giveAttr (" interrupt_main" , new BoxedBuiltinFunctionOrMethod (
237+ FunctionMetadata::create ((void *)interruptMain, UNKNOWN, 0 ), " interrupt_main"
238+ ));
230239 thread_module->giveAttr (" _count" , new BoxedBuiltinFunctionOrMethod (
231240 FunctionMetadata::create ((void *)threadCount, BOXED_INT, 0 ), " _count" ));
232241
You can’t perform that action at this time.
0 commit comments