Commit 65da401a authored by Simon Marlow's avatar Simon Marlow

Windows: use a thread-local variable for myTask()

Which entailed fixing an incorrect #ifdef in Task.c
parent c76348fc
...@@ -63,8 +63,10 @@ initTaskManager (void) ...@@ -63,8 +63,10 @@ initTaskManager (void)
if (!tasksInitialized) { if (!tasksInitialized) {
taskCount = 0; taskCount = 0;
tasksInitialized = 1; tasksInitialized = 1;
#if defined(THREADED_RTS) && !defined(MYTASK_USE_TLV) #if defined(THREADED_RTS)
#if !defined(MYTASK_USE_TLV)
newThreadLocalKey(&currentTaskKey); newThreadLocalKey(&currentTaskKey);
#endif
initMutex(&all_tasks_mutex); initMutex(&all_tasks_mutex);
#endif #endif
} }
......
...@@ -233,8 +233,9 @@ void startWorkerTask (Capability *cap); ...@@ -233,8 +233,9 @@ void startWorkerTask (Capability *cap);
// A thread-local-storage key that we can use to get access to the // A thread-local-storage key that we can use to get access to the
// current thread's Task structure. // current thread's Task structure.
#if defined(THREADED_RTS) #if defined(THREADED_RTS)
#if defined(linux_HOST_OS) && \ #if (defined(linux_HOST_OS) && \
(defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)) (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \
(defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
#define MYTASK_USE_TLV #define MYTASK_USE_TLV
extern __thread Task *my_task; extern __thread Task *my_task;
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment