projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove now-unused compiler/Makefile.local
[ghc-hetmet.git]
/
rts
/
Task.h
diff --git
a/rts/Task.h
b/rts/Task.h
index
c2b58f2
..
424af60
100644
(file)
--- a/
rts/Task.h
+++ b/
rts/Task.h
@@
-4,6
+4,9
@@
*
* Tasks
*
*
* Tasks
*
+ * For details on the high-level design, see
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Scheduler
+ *
* -------------------------------------------------------------------------*/
#ifndef TASK_H
* -------------------------------------------------------------------------*/
#ifndef TASK_H
@@
-11,7
+14,7
@@
#include "GetTime.h"
#include "GetTime.h"
-BEGIN_RTS_PRIVATE
+#include "BeginPrivate.h"
/*
Definition of a Task
/*
Definition of a Task
@@
-83,6
+86,9
@@
typedef struct InCall_ {
// without owning a Capability in the
// first place.
// 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
struct Task_ *task;
// When a Haskell thread makes a foreign call that re-enters
@@
-134,8
+140,8
@@
typedef struct Task_ {
rtsBool worker; // == rtsTrue if this is a worker Task
rtsBool stopped; // this task has stopped or exited Haskell
rtsBool worker; // == rtsTrue if this is a worker Task
rtsBool stopped; // this task has stopped or exited Haskell
- SchedulerStatus stat; // return status
- StgClosure ** ret; // return value
+ // So that we can detect when a finalizer illegally calls back into Haskell
+ rtsBool running_finalizers;
// Stats that we collect about this task
// ToDo: we probably want to put this in a separate TaskStats
// Stats that we collect about this task
// ToDo: we probably want to put this in a separate TaskStats
@@
-201,6
+207,9
@@
void workerTaskStop (Task *task);
//
void taskTimeStamp (Task *task);
//
void taskTimeStamp (Task *task);
+// The current Task has finished a GC, record the amount of time spent.
+void taskDoneGC (Task *task, Ticks cpu_time, Ticks elapsed_time);
+
// Put the task back on the free list, mark it stopped. Used by
// forkProcess().
//
// Put the task back on the free list, mark it stopped. Used by
// forkProcess().
//
@@
-219,6
+228,11
@@
INLINE_HEADER Task *myTask (void);
//
void startWorkerTask (Capability *cap);
//
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 */
// -----------------------------------------------------------------------------
#endif /* THREADED_RTS */
// -----------------------------------------------------------------------------
@@
-227,8
+241,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)
// 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
#define MYTASK_USE_TLV
extern __thread Task *my_task;
#else
@@
-264,6
+279,6
@@
setMyTask (Task *task)
#endif
}
#endif
}
-END_RTS_PRIVATE
+#include "EndPrivate.h"
#endif /* TASK_H */
#endif /* TASK_H */