diff options
author | David Eichmann <EichmannD@gmail.com> | 2020-10-19 17:03:41 +0100 |
---|---|---|
committer | David Eichmann <EichmannD@gmail.com> | 2020-10-30 13:43:44 +0000 |
commit | c83b97d19889d0844f73a26f36d3169f698e92c8 (patch) | |
tree | 92e832e68e6ccf4934c5de988f3f8971e11eca9a /rts/Task.c | |
parent | 28f98b01d055c8027f9495b1669bf875b3e42168 (diff) | |
download | haskell-wip/ghc-debug_pause_and_resume.tar.gz |
RtsAPI: pause and resume the RTSwip/ghc-debug_pause_and_resume
The `rts_pause` and `rts_resume` functions have been added to `RtsAPI.h` and
allow an external process to completely pause and resume the RTS.
Co-authored-by: Sven Tennie <sven.tennie@gmail.com>
Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: Ben Gamari <bgamari.foss@gmail.com>
Diffstat (limited to 'rts/Task.c')
-rw-r--r-- | rts/Task.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rts/Task.c b/rts/Task.c index 11ba5f1581..e5963dccc6 100644 --- a/rts/Task.c +++ b/rts/Task.c @@ -118,7 +118,7 @@ freeTaskManager (void) return tasksRunning; } -Task* getTask (void) +Task* getMyTask (void) { Task *task; @@ -306,7 +306,7 @@ newBoundTask (void) stg_exit(EXIT_FAILURE); } - task = getTask(); + task = getMyTask(); task->stopped = false; @@ -317,13 +317,12 @@ newBoundTask (void) } void -boundTaskExiting (Task *task) +exitMyTask (void) { + Task* task = myTask(); #if defined(THREADED_RTS) ASSERT(osThreadId() == task->id); #endif - ASSERT(myTask() == task); - endInCall(task); // Set task->stopped, but only if this is the last call (#4850). @@ -524,7 +523,7 @@ void rts_setInCallCapability ( int preferred_capability, int affinity USED_IF_THREADS) { - Task *task = getTask(); + Task *task = getMyTask(); task->preferred_capability = preferred_capability; #if defined(THREADED_RTS) @@ -541,7 +540,7 @@ void rts_pinThreadToNumaNode ( { #if defined(THREADED_RTS) if (RtsFlags.GcFlags.numa) { - Task *task = getTask(); + Task *task = getMyTask(); task->node = capNoToNumaNode(node); if (!DEBUG_IS_ON || !RtsFlags.DebugFlags.numa) { // faking NUMA setThreadNode(numa_map[task->node]); |