summaryrefslogtreecommitdiff
path: root/rts/Task.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Task.c')
-rw-r--r--rts/Task.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/rts/Task.c b/rts/Task.c
index cf406b2abe..9e8214899c 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -49,6 +49,9 @@ __thread Task *my_task;
# else
ThreadLocalKey currentTaskKey;
# endif
+#ifdef llvm_CC_FLAVOR
+ThreadLocalKey gctKey;
+#endif
#else
Task *my_task;
#endif
@@ -67,6 +70,9 @@ initTaskManager (void)
#if !defined(MYTASK_USE_TLV)
newThreadLocalKey(&currentTaskKey);
#endif
+#if defined(llvm_CC_FLAVOR)
+ newThreadLocalKey(&gctKey);
+#endif
initMutex(&all_tasks_mutex);
#endif
}
@@ -96,10 +102,15 @@ freeTaskManager (void)
RELEASE_LOCK(&all_tasks_mutex);
-#if defined(THREADED_RTS) && !defined(MYTASK_USE_TLV)
+#if defined(THREADED_RTS)
closeMutex(&all_tasks_mutex);
+#if !defined(MYTASK_USE_TLV)
freeThreadLocalKey(&currentTaskKey);
#endif
+#if defined(llvm_CC_FLAVOR)
+ freeThreadLocalKey(&gctKey);
+#endif
+#endif
tasksInitialized = 0;