X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FSchedule.h;h=d11162e47dcf091ad5b3949e97d480641db58bad;hb=4368121d93643f6f108c1dc79ac212bf02e56f98;hp=63dfeb7dd51f89c82788f7f639acb426efbf8366;hpb=354cefe72823fd519063b526ed7f76968ba80f5e;p=ghc-hetmet.git diff --git a/ghc/rts/Schedule.h b/ghc/rts/Schedule.h index 63dfeb7..d11162e 100644 --- a/ghc/rts/Schedule.h +++ b/ghc/rts/Schedule.h @@ -259,6 +259,20 @@ appendToBlockedQueue(StgTSO *tso) } #endif +#if defined(THREADED_RTS) +STATIC_INLINE void +appendToWakeupQueue (Capability *cap, StgTSO *tso) +{ + ASSERT(tso->link == END_TSO_QUEUE); + if (cap->wakeup_queue_hd == END_TSO_QUEUE) { + cap->wakeup_queue_hd = tso; + } else { + cap->wakeup_queue_tl->link = tso; + } + cap->wakeup_queue_tl = tso; +} +#endif + /* Check whether various thread queues are empty */ STATIC_INLINE rtsBool @@ -273,6 +287,14 @@ emptyRunQueue(Capability *cap) return emptyQueue(cap->run_queue_hd); } +#if defined(THREADED_RTS) +STATIC_INLINE rtsBool +emptyWakeupQueue(Capability *cap) +{ + return emptyQueue(cap->wakeup_queue_hd); +} +#endif + #if !defined(THREADED_RTS) #define EMPTY_BLOCKED_QUEUE() (emptyQueue(blocked_queue_hd)) #define EMPTY_SLEEPING_QUEUE() (emptyQueue(sleeping_queue))