1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 2003-2006
7 * A Capability represent the token required to execute STG code,
8 * and all the state an OS thread/task needs to run Haskell code:
9 * its STG registers, a pointer to its TSO, a nursery etc. During
10 * STG execution, a pointer to the capabilitity is kept in a
11 * register (BaseReg; actually it is a pointer to cap->r).
13 * Only in an THREADED_RTS build will there be multiple capabilities,
14 * for non-threaded builds there is only one global capability, namely
17 * --------------------------------------------------------------------------*/
19 #include "PosixSource.h"
24 #include "OSThreads.h"
25 #include "Capability.h"
30 // one global capability, this is the Capability for non-threaded
31 // builds, and for +RTS -N1
32 Capability MainCapability;
35 Capability *capabilities = NULL;
37 // Holds the Capability which last became free. This is used so that
38 // an in-call has a chance of quickly finding a free Capability.
39 // Maintaining a global free list of Capabilities would require global
40 // locking, so we don't do that.
41 Capability *last_free_capability;
43 /* GC indicator, in scope for the scheduler, init'ed to false */
44 volatile StgWord waiting_for_gc = 0;
46 #if defined(THREADED_RTS)
50 return blackholes_need_checking
51 || sched_state >= SCHED_INTERRUPTING
56 #if defined(THREADED_RTS)
58 findSpark (Capability *cap)
60 /* use the normal Sparks.h interface (internally modified to enable
62 and immediately turn the spark into a thread when successful
69 // first try to get a spark from our own pool.
70 // We should be using reclaimSpark(), because it works without
71 // needing any atomic instructions:
72 // spark = reclaimSpark(cap->sparks);
73 // However, measurements show that this makes at least one benchmark
74 // slower (prsa) and doesn't affect the others.
75 spark = tryStealSpark(cap);
77 cap->sparks_converted++;
81 if (n_capabilities == 1) { return NULL; } // makes no sense...
83 debugTrace(DEBUG_sched,
84 "cap %d: Trying to steal work from other capabilities",
90 /* visit cap.s 0..n-1 in sequence until a theft succeeds. We could
91 start at a random place instead of 0 as well. */
92 for ( i=0 ; i < n_capabilities ; i++ ) {
93 robbed = &capabilities[i];
94 if (cap == robbed) // ourselves...
97 if (emptySparkPoolCap(robbed)) // nothing to steal here
100 spark = tryStealSpark(robbed);
101 if (spark == NULL && !emptySparkPoolCap(robbed)) {
102 // we conflicted with another thread while trying to steal;
108 debugTrace(DEBUG_sched,
109 "cap %d: Stole a spark from capability %d",
110 cap->no, robbed->no);
111 cap->sparks_converted++;
114 // otherwise: no success, try next one
118 debugTrace(DEBUG_sched, "No sparks stolen");
122 // Returns True if any spark pool is non-empty at this moment in time
123 // The result is only valid for an instant, of course, so in a sense
124 // is immediately invalid, and should not be relied upon for
131 for (i=0; i < n_capabilities; i++) {
132 if (!emptySparkPoolCap(&capabilities[i])) {
140 /* -----------------------------------------------------------------------------
141 * Manage the returning_tasks lists.
143 * These functions require cap->lock
144 * -------------------------------------------------------------------------- */
146 #if defined(THREADED_RTS)
148 newReturningTask (Capability *cap, Task *task)
150 ASSERT_LOCK_HELD(&cap->lock);
151 ASSERT(task->return_link == NULL);
152 if (cap->returning_tasks_hd) {
153 ASSERT(cap->returning_tasks_tl->return_link == NULL);
154 cap->returning_tasks_tl->return_link = task;
156 cap->returning_tasks_hd = task;
158 cap->returning_tasks_tl = task;
162 popReturningTask (Capability *cap)
164 ASSERT_LOCK_HELD(&cap->lock);
166 task = cap->returning_tasks_hd;
168 cap->returning_tasks_hd = task->return_link;
169 if (!cap->returning_tasks_hd) {
170 cap->returning_tasks_tl = NULL;
172 task->return_link = NULL;
177 /* ----------------------------------------------------------------------------
180 * The Capability is initially marked not free.
181 * ------------------------------------------------------------------------- */
184 initCapability( Capability *cap, nat i )
189 cap->in_haskell = rtsFalse;
191 cap->run_queue_hd = END_TSO_QUEUE;
192 cap->run_queue_tl = END_TSO_QUEUE;
194 #if defined(THREADED_RTS)
195 initMutex(&cap->lock);
196 cap->running_task = NULL; // indicates cap is free
197 cap->spare_workers = NULL;
198 cap->suspended_ccalling_tasks = NULL;
199 cap->returning_tasks_hd = NULL;
200 cap->returning_tasks_tl = NULL;
201 cap->wakeup_queue_hd = END_TSO_QUEUE;
202 cap->wakeup_queue_tl = END_TSO_QUEUE;
203 cap->sparks_created = 0;
204 cap->sparks_converted = 0;
205 cap->sparks_pruned = 0;
208 cap->f.stgGCEnter1 = (F_)__stg_gc_enter_1;
209 cap->f.stgGCFun = (F_)__stg_gc_fun;
211 cap->mut_lists = stgMallocBytes(sizeof(bdescr *) *
212 RtsFlags.GcFlags.generations,
215 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
216 cap->mut_lists[g] = NULL;
219 cap->free_tvar_watch_queues = END_STM_WATCH_QUEUE;
220 cap->free_invariant_check_queues = END_INVARIANT_CHECK_QUEUE;
221 cap->free_trec_chunks = END_STM_CHUNK_LIST;
222 cap->free_trec_headers = NO_TREC;
223 cap->transaction_tokens = 0;
224 cap->context_switch = 0;
227 /* ---------------------------------------------------------------------------
228 * Function: initCapabilities()
230 * Purpose: set up the Capability handling. For the THREADED_RTS build,
231 * we keep a table of them, the size of which is
232 * controlled by the user via the RTS flag -N.
234 * ------------------------------------------------------------------------- */
236 initCapabilities( void )
238 #if defined(THREADED_RTS)
242 // We can't support multiple CPUs if BaseReg is not a register
243 if (RtsFlags.ParFlags.nNodes > 1) {
244 errorBelch("warning: multiple CPUs not supported in this build, reverting to 1");
245 RtsFlags.ParFlags.nNodes = 1;
249 n_capabilities = RtsFlags.ParFlags.nNodes;
251 if (n_capabilities == 1) {
252 capabilities = &MainCapability;
253 // THREADED_RTS must work on builds that don't have a mutable
254 // BaseReg (eg. unregisterised), so in this case
255 // capabilities[0] must coincide with &MainCapability.
257 capabilities = stgMallocBytes(n_capabilities * sizeof(Capability),
261 for (i = 0; i < n_capabilities; i++) {
262 initCapability(&capabilities[i], i);
265 debugTrace(DEBUG_sched, "allocated %d capabilities", n_capabilities);
267 #else /* !THREADED_RTS */
270 capabilities = &MainCapability;
271 initCapability(&MainCapability, 0);
275 // There are no free capabilities to begin with. We will start
276 // a worker Task to each Capability, which will quickly put the
277 // Capability on the free list when it finds nothing to do.
278 last_free_capability = &capabilities[0];
281 /* ----------------------------------------------------------------------------
282 * setContextSwitches: cause all capabilities to context switch as
284 * ------------------------------------------------------------------------- */
286 void setContextSwitches(void)
289 for (i=0; i < n_capabilities; i++) {
290 capabilities[i].context_switch = 1;
294 /* ----------------------------------------------------------------------------
295 * Give a Capability to a Task. The task must currently be sleeping
296 * on its condition variable.
298 * Requires cap->lock (modifies cap->running_task).
300 * When migrating a Task, the migrater must take task->lock before
301 * modifying task->cap, to synchronise with the waking up Task.
302 * Additionally, the migrater should own the Capability (when
303 * migrating the run queue), or cap->lock (when migrating
304 * returning_workers).
306 * ------------------------------------------------------------------------- */
308 #if defined(THREADED_RTS)
310 giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task)
312 ASSERT_LOCK_HELD(&cap->lock);
313 ASSERT(task->cap == cap);
314 trace(TRACE_sched | DEBUG_sched,
315 "passing capability %d to %s %p",
316 cap->no, task->tso ? "bound task" : "worker",
318 ACQUIRE_LOCK(&task->lock);
319 task->wakeup = rtsTrue;
320 // the wakeup flag is needed because signalCondition() doesn't
321 // flag the condition if the thread is already runniing, but we want
323 signalCondition(&task->cond);
324 RELEASE_LOCK(&task->lock);
328 /* ----------------------------------------------------------------------------
329 * Function: releaseCapability(Capability*)
331 * Purpose: Letting go of a capability. Causes a
332 * 'returning worker' thread or a 'waiting worker'
333 * to wake up, in that order.
334 * ------------------------------------------------------------------------- */
336 #if defined(THREADED_RTS)
338 releaseCapability_ (Capability* cap,
339 rtsBool always_wakeup)
343 task = cap->running_task;
345 ASSERT_PARTIAL_CAPABILITY_INVARIANTS(cap,task);
347 cap->running_task = NULL;
349 // Check to see whether a worker thread can be given
350 // the go-ahead to return the result of an external call..
351 if (cap->returning_tasks_hd != NULL) {
352 giveCapabilityToTask(cap,cap->returning_tasks_hd);
353 // The Task pops itself from the queue (see waitForReturnCapability())
357 /* if waiting_for_gc was the reason to release the cap: thread
358 comes from yieldCap->releaseAndQueueWorker. Unconditionally set
359 cap. free and return (see default after the if-protected other
360 special cases). Thread will wait on cond.var and re-acquire the
361 same cap after GC (GC-triggering cap. calls releaseCap and
362 enters the spare_workers case)
364 if (waiting_for_gc) {
365 last_free_capability = cap; // needed?
366 trace(TRACE_sched | DEBUG_sched,
367 "GC pending, set capability %d free", cap->no);
372 // If the next thread on the run queue is a bound thread,
373 // give this Capability to the appropriate Task.
374 if (!emptyRunQueue(cap) && cap->run_queue_hd->bound) {
375 // Make sure we're not about to try to wake ourselves up
376 ASSERT(task != cap->run_queue_hd->bound);
377 task = cap->run_queue_hd->bound;
378 giveCapabilityToTask(cap,task);
382 if (!cap->spare_workers) {
383 // Create a worker thread if we don't have one. If the system
384 // is interrupted, we only create a worker task if there
385 // are threads that need to be completed. If the system is
386 // shutting down, we never create a new worker.
387 if (sched_state < SCHED_SHUTTING_DOWN || !emptyRunQueue(cap)) {
388 debugTrace(DEBUG_sched,
389 "starting new worker on capability %d", cap->no);
390 startWorkerTask(cap, workerStart);
395 // If we have an unbound thread on the run queue, or if there's
396 // anything else to do, give the Capability to a worker thread.
398 !emptyRunQueue(cap) || !emptyWakeupQueue(cap) ||
399 !emptySparkPoolCap(cap) || globalWorkToDo()) {
400 if (cap->spare_workers) {
401 giveCapabilityToTask(cap,cap->spare_workers);
402 // The worker Task pops itself from the queue;
407 last_free_capability = cap;
408 trace(TRACE_sched | DEBUG_sched, "freeing capability %d", cap->no);
412 releaseCapability (Capability* cap USED_IF_THREADS)
414 ACQUIRE_LOCK(&cap->lock);
415 releaseCapability_(cap, rtsFalse);
416 RELEASE_LOCK(&cap->lock);
420 releaseAndWakeupCapability (Capability* cap USED_IF_THREADS)
422 ACQUIRE_LOCK(&cap->lock);
423 releaseCapability_(cap, rtsTrue);
424 RELEASE_LOCK(&cap->lock);
428 releaseCapabilityAndQueueWorker (Capability* cap USED_IF_THREADS)
432 ACQUIRE_LOCK(&cap->lock);
434 task = cap->running_task;
436 // If the current task is a worker, save it on the spare_workers
437 // list of this Capability. A worker can mark itself as stopped,
438 // in which case it is not replaced on the spare_worker queue.
439 // This happens when the system is shutting down (see
440 // Schedule.c:workerStart()).
441 // Also, be careful to check that this task hasn't just exited
442 // Haskell to do a foreign call (task->suspended_tso).
443 if (!isBoundTask(task) && !task->stopped && !task->suspended_tso) {
444 task->next = cap->spare_workers;
445 cap->spare_workers = task;
447 // Bound tasks just float around attached to their TSOs.
449 releaseCapability_(cap,rtsFalse);
451 RELEASE_LOCK(&cap->lock);
455 /* ----------------------------------------------------------------------------
456 * waitForReturnCapability( Task *task )
458 * Purpose: when an OS thread returns from an external call,
459 * it calls waitForReturnCapability() (via Schedule.resumeThread())
460 * to wait for permission to enter the RTS & communicate the
461 * result of the external call back to the Haskell thread that
464 * ------------------------------------------------------------------------- */
466 waitForReturnCapability (Capability **pCap, Task *task)
468 #if !defined(THREADED_RTS)
470 MainCapability.running_task = task;
471 task->cap = &MainCapability;
472 *pCap = &MainCapability;
475 Capability *cap = *pCap;
478 // Try last_free_capability first
479 cap = last_free_capability;
480 if (!cap->running_task) {
482 // otherwise, search for a free capability
483 for (i = 0; i < n_capabilities; i++) {
484 cap = &capabilities[i];
485 if (!cap->running_task) {
489 // Can't find a free one, use last_free_capability.
490 cap = last_free_capability;
493 // record the Capability as the one this Task is now assocated with.
497 ASSERT(task->cap == cap);
500 ACQUIRE_LOCK(&cap->lock);
502 debugTrace(DEBUG_sched, "returning; I want capability %d", cap->no);
504 if (!cap->running_task) {
505 // It's free; just grab it
506 cap->running_task = task;
507 RELEASE_LOCK(&cap->lock);
509 newReturningTask(cap,task);
510 RELEASE_LOCK(&cap->lock);
513 ACQUIRE_LOCK(&task->lock);
514 // task->lock held, cap->lock not held
515 if (!task->wakeup) waitCondition(&task->cond, &task->lock);
517 task->wakeup = rtsFalse;
518 RELEASE_LOCK(&task->lock);
520 // now check whether we should wake up...
521 ACQUIRE_LOCK(&cap->lock);
522 if (cap->running_task == NULL) {
523 if (cap->returning_tasks_hd != task) {
524 giveCapabilityToTask(cap,cap->returning_tasks_hd);
525 RELEASE_LOCK(&cap->lock);
528 cap->running_task = task;
529 popReturningTask(cap);
530 RELEASE_LOCK(&cap->lock);
533 RELEASE_LOCK(&cap->lock);
538 ASSERT_FULL_CAPABILITY_INVARIANTS(cap,task);
540 trace(TRACE_sched | DEBUG_sched, "resuming capability %d", cap->no);
546 #if defined(THREADED_RTS)
547 /* ----------------------------------------------------------------------------
549 * ------------------------------------------------------------------------- */
552 yieldCapability (Capability** pCap, Task *task)
554 Capability *cap = *pCap;
556 debugTrace(DEBUG_sched, "giving up capability %d", cap->no);
558 // We must now release the capability and wait to be woken up
560 task->wakeup = rtsFalse;
561 releaseCapabilityAndQueueWorker(cap);
564 ACQUIRE_LOCK(&task->lock);
565 // task->lock held, cap->lock not held
566 if (!task->wakeup) waitCondition(&task->cond, &task->lock);
568 task->wakeup = rtsFalse;
569 RELEASE_LOCK(&task->lock);
571 debugTrace(DEBUG_sched, "woken up on capability %d", cap->no);
573 ACQUIRE_LOCK(&cap->lock);
574 if (cap->running_task != NULL) {
575 debugTrace(DEBUG_sched,
576 "capability %d is owned by another task", cap->no);
577 RELEASE_LOCK(&cap->lock);
581 if (task->tso == NULL) {
582 ASSERT(cap->spare_workers != NULL);
583 // if we're not at the front of the queue, release it
584 // again. This is unlikely to happen.
585 if (cap->spare_workers != task) {
586 giveCapabilityToTask(cap,cap->spare_workers);
587 RELEASE_LOCK(&cap->lock);
590 cap->spare_workers = task->next;
593 cap->running_task = task;
594 RELEASE_LOCK(&cap->lock);
598 trace(TRACE_sched | DEBUG_sched, "resuming capability %d", cap->no);
599 ASSERT(cap->running_task == task);
603 ASSERT_FULL_CAPABILITY_INVARIANTS(cap,task);
608 /* ----------------------------------------------------------------------------
609 * Wake up a thread on a Capability.
611 * This is used when the current Task is running on a Capability and
612 * wishes to wake up a thread on a different Capability.
613 * ------------------------------------------------------------------------- */
616 wakeupThreadOnCapability (Capability *my_cap,
617 Capability *other_cap,
620 ACQUIRE_LOCK(&other_cap->lock);
622 // ASSUMES: cap->lock is held (asserted in wakeupThreadOnCapability)
624 ASSERT(tso->bound->cap == tso->cap);
625 tso->bound->cap = other_cap;
627 tso->cap = other_cap;
629 ASSERT(tso->bound ? tso->bound->cap == other_cap : 1);
631 if (other_cap->running_task == NULL) {
632 // nobody is running this Capability, we can add our thread
633 // directly onto the run queue and start up a Task to run it.
635 other_cap->running_task = myTask();
636 // precond for releaseCapability_() and appendToRunQueue()
638 appendToRunQueue(other_cap,tso);
640 trace(TRACE_sched, "resuming capability %d", other_cap->no);
641 releaseCapability_(other_cap,rtsFalse);
643 appendToWakeupQueue(my_cap,other_cap,tso);
644 other_cap->context_switch = 1;
645 // someone is running on this Capability, so it cannot be
646 // freed without first checking the wakeup queue (see
647 // releaseCapability_).
650 RELEASE_LOCK(&other_cap->lock);
653 /* ----------------------------------------------------------------------------
656 * Used to indicate that the interrupted flag is now set, or some
657 * other global condition that might require waking up a Task on each
659 * ------------------------------------------------------------------------- */
662 prodCapabilities(rtsBool all)
668 for (i=0; i < n_capabilities; i++) {
669 cap = &capabilities[i];
670 ACQUIRE_LOCK(&cap->lock);
671 if (!cap->running_task) {
672 if (cap->spare_workers) {
673 trace(TRACE_sched, "resuming capability %d", cap->no);
674 task = cap->spare_workers;
675 ASSERT(!task->stopped);
676 giveCapabilityToTask(cap,task);
678 RELEASE_LOCK(&cap->lock);
683 RELEASE_LOCK(&cap->lock);
689 prodAllCapabilities (void)
691 prodCapabilities(rtsTrue);
694 /* ----------------------------------------------------------------------------
697 * Like prodAllCapabilities, but we only require a single Task to wake
698 * up in order to service some global event, such as checking for
699 * deadlock after some idle time has passed.
700 * ------------------------------------------------------------------------- */
703 prodOneCapability (void)
705 prodCapabilities(rtsFalse);
708 /* ----------------------------------------------------------------------------
711 * At shutdown time, we want to let everything exit as cleanly as
712 * possible. For each capability, we let its run queue drain, and
713 * allow the workers to stop.
715 * This function should be called when interrupted and
716 * shutting_down_scheduler = rtsTrue, thus any worker that wakes up
717 * will exit the scheduler and call taskStop(), and any bound thread
718 * that wakes up will return to its caller. Runnable threads are
721 * ------------------------------------------------------------------------- */
724 shutdownCapability (Capability *cap, Task *task, rtsBool safe)
730 // Loop indefinitely until all the workers have exited and there
731 // are no Haskell threads left. We used to bail out after 50
732 // iterations of this loop, but that occasionally left a worker
733 // running which caused problems later (the closeMutex() below
734 // isn't safe, for one thing).
736 for (i = 0; /* i < 50 */; i++) {
737 ASSERT(sched_state == SCHED_SHUTTING_DOWN);
739 debugTrace(DEBUG_sched,
740 "shutting down capability %d, attempt %d", cap->no, i);
741 ACQUIRE_LOCK(&cap->lock);
742 if (cap->running_task) {
743 RELEASE_LOCK(&cap->lock);
744 debugTrace(DEBUG_sched, "not owner, yielding");
748 cap->running_task = task;
750 if (cap->spare_workers) {
751 // Look for workers that have died without removing
752 // themselves from the list; this could happen if the OS
753 // summarily killed the thread, for example. This
754 // actually happens on Windows when the system is
755 // terminating the program, and the RTS is running in a
759 for (t = cap->spare_workers; t != NULL; t = t->next) {
760 if (!osThreadIsAlive(t->id)) {
761 debugTrace(DEBUG_sched,
762 "worker thread %p has died unexpectedly", (void *)t->id);
764 cap->spare_workers = t->next;
766 prev->next = t->next;
773 if (!emptyRunQueue(cap) || cap->spare_workers) {
774 debugTrace(DEBUG_sched,
775 "runnable threads or workers still alive, yielding");
776 releaseCapability_(cap,rtsFalse); // this will wake up a worker
777 RELEASE_LOCK(&cap->lock);
782 // If "safe", then busy-wait for any threads currently doing
783 // foreign calls. If we're about to unload this DLL, for
784 // example, we need to be sure that there are no OS threads
785 // that will try to return to code that has been unloaded.
786 // We can be a bit more relaxed when this is a standalone
787 // program that is about to terminate, and let safe=false.
788 if (cap->suspended_ccalling_tasks && safe) {
789 debugTrace(DEBUG_sched,
790 "thread(s) are involved in foreign calls, yielding");
791 cap->running_task = NULL;
792 RELEASE_LOCK(&cap->lock);
797 debugTrace(DEBUG_sched, "capability %d is stopped.", cap->no);
798 RELEASE_LOCK(&cap->lock);
801 // we now have the Capability, its run queue and spare workers
802 // list are both empty.
804 // ToDo: we can't drop this mutex, because there might still be
805 // threads performing foreign calls that will eventually try to
806 // return via resumeThread() and attempt to grab cap->lock.
807 // closeMutex(&cap->lock);
810 /* ----------------------------------------------------------------------------
813 * Attempt to gain control of a Capability if it is free.
815 * ------------------------------------------------------------------------- */
818 tryGrabCapability (Capability *cap, Task *task)
820 if (cap->running_task != NULL) return rtsFalse;
821 ACQUIRE_LOCK(&cap->lock);
822 if (cap->running_task != NULL) {
823 RELEASE_LOCK(&cap->lock);
827 cap->running_task = task;
828 RELEASE_LOCK(&cap->lock);
833 #endif /* THREADED_RTS */
836 freeCapability (Capability *cap)
838 stgFree(cap->mut_lists);
839 #if defined(THREADED_RTS) || defined(PARALLEL_HASKELL)
840 freeSparkPool(cap->sparks);
845 freeCapabilities (void)
847 #if defined(THREADED_RTS)
849 for (i=0; i < n_capabilities; i++) {
850 freeCapability(&capabilities[i]);
853 freeCapability(&MainCapability);
857 /* ---------------------------------------------------------------------------
858 Mark everything directly reachable from the Capabilities. When
859 using multiple GC threads, each GC thread marks all Capabilities
860 for which (c `mod` n == 0), for Capability c and thread n.
861 ------------------------------------------------------------------------ */
864 markSomeCapabilities (evac_fn evac, void *user, nat i0, nat delta,
865 rtsBool prune_sparks USED_IF_THREADS)
871 // Each GC thread is responsible for following roots from the
872 // Capability of the same number. There will usually be the same
873 // or fewer Capabilities as GC threads, but just in case there
874 // are more, we mark every Capability whose number is the GC
875 // thread's index plus a multiple of the number of GC threads.
876 for (i = i0; i < n_capabilities; i += delta) {
877 cap = &capabilities[i];
878 evac(user, (StgClosure **)(void *)&cap->run_queue_hd);
879 evac(user, (StgClosure **)(void *)&cap->run_queue_tl);
880 #if defined(THREADED_RTS)
881 evac(user, (StgClosure **)(void *)&cap->wakeup_queue_hd);
882 evac(user, (StgClosure **)(void *)&cap->wakeup_queue_tl);
884 for (task = cap->suspended_ccalling_tasks; task != NULL;
886 debugTrace(DEBUG_sched,
887 "evac'ing suspended TSO %lu", (unsigned long)task->suspended_tso->id);
888 evac(user, (StgClosure **)(void *)&task->suspended_tso);
891 #if defined(THREADED_RTS)
893 pruneSparkQueue (evac, user, cap);
895 traverseSparkQueue (evac, user, cap);
900 #if !defined(THREADED_RTS)
901 evac(user, (StgClosure **)(void *)&blocked_queue_hd);
902 evac(user, (StgClosure **)(void *)&blocked_queue_tl);
903 evac(user, (StgClosure **)(void *)&sleeping_queue);
908 markCapabilities (evac_fn evac, void *user)
910 markSomeCapabilities(evac, user, 0, 1, rtsFalse);