X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2FTask.h;h=38e4763b5a350d8533b42a13133e4869c4abbc60;hp=2e0a4b83fae57737ddbc7b9d7cae14833ffa7021;hb=83d563cb9ede0ba792836e529b1e2929db926355;hpb=497f8aa6c2c8770daf3d39f57ee5e04dcdcc3778 diff --git a/rts/Task.h b/rts/Task.h index 2e0a4b8..38e4763 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -4,6 +4,9 @@ * * Tasks * + * For details on the high-level design, see + * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Scheduler + * * -------------------------------------------------------------------------*/ #ifndef TASK_H @@ -11,7 +14,7 @@ #include "GetTime.h" -BEGIN_RTS_PRIVATE +#include "BeginPrivate.h" /* Definition of a Task @@ -83,6 +86,9 @@ typedef struct InCall_ { // without owning a Capability in the // first place. + SchedulerStatus stat; // return status + StgClosure ** ret; // return value + struct Task_ *task; // When a Haskell thread makes a foreign call that re-enters @@ -137,9 +143,6 @@ typedef struct Task_ { // So that we can detect when a finalizer illegally calls back into Haskell rtsBool running_finalizers; - SchedulerStatus stat; // return status - StgClosure ** ret; // return value - // Stats that we collect about this task // ToDo: we probably want to put this in a separate TaskStats // structure, so we can share it between multiple Tasks. We don't @@ -222,6 +225,11 @@ INLINE_HEADER Task *myTask (void); // void startWorkerTask (Capability *cap); +// Interrupts a worker task that is performing an FFI call. The thread +// should not be destroyed. +// +void interruptWorkerTask (Task *task); + #endif /* THREADED_RTS */ // ----------------------------------------------------------------------------- @@ -230,8 +238,9 @@ void startWorkerTask (Capability *cap); // A thread-local-storage key that we can use to get access to the // current thread's Task structure. #if defined(THREADED_RTS) -#if defined(linux_HOST_OS) && \ - (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)) +#if (defined(linux_HOST_OS) && \ + (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \ + (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4) #define MYTASK_USE_TLV extern __thread Task *my_task; #else @@ -267,6 +276,6 @@ setMyTask (Task *task) #endif } -END_RTS_PRIVATE +#include "EndPrivate.h" #endif /* TASK_H */