summaryrefslogtreecommitdiff
path: root/rts/Task.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Task.c')
-rw-r--r--rts/Task.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/rts/Task.c b/rts/Task.c
index e93d60d86f..f26785a1be 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -409,6 +409,15 @@ startWorkerTask (Capability *cap)
RELEASE_LOCK(&task->lock);
}
+void
+interruptWorkerTask (Task *task)
+{
+ ASSERT(osThreadId() != task->id); // seppuku not allowed
+ ASSERT(task->incall->suspended_tso); // use this only for FFI calls
+ interruptOSThread(task->id);
+ debugTrace(DEBUG_sched, "interrupted worker task %lu", task->id);
+}
+
#endif /* THREADED_RTS */
#ifdef DEBUG