Commit 5e856f00 authored by sof's avatar sof
Browse files

[project @ 2002-02-14 08:59:29 by sof]

debugged
parent 40d97663
...@@ -68,7 +68,7 @@ void ...@@ -68,7 +68,7 @@ void
initCapabilities() initCapabilities()
{ {
#if defined(RTS_SUPPORTS_THREADS) #if defined(RTS_SUPPORTS_THREADS)
initCondition(returning_worker_cond); initCondition(&returning_worker_cond);
#endif #endif
#if defined(SMP) #if defined(SMP)
...@@ -177,12 +177,12 @@ void ...@@ -177,12 +177,12 @@ void
grabReturnCapability(Capability** pCap) grabReturnCapability(Capability** pCap)
{ {
IF_DEBUG(scheduler, IF_DEBUG(scheduler,
sched_belch("thread %d: returning, waiting for sched. lock.\n", osThreadId())); fprintf(stderr,"worker (%ld): returning, waiting for sched. lock.\n", osThreadId()));
ACQUIRE_LOCK(&sched_mutex); ACQUIRE_LOCK(&sched_mutex);
rts_n_waiting_workers++; rts_n_waiting_workers++;
IF_DEBUG(scheduler, IF_DEBUG(scheduler,
sched_belch("worker (%d,%d): returning; workers waiting: %d\n", fprintf(stderr,"worker (%ld): returning; workers waiting: %d\n",
tok, osThreadId(), rts_n_waiting_workers)); osThreadId(), rts_n_waiting_workers));
while ( noCapabilities() ) { while ( noCapabilities() ) {
waitCondition(&returning_worker_cond, &sched_mutex); waitCondition(&returning_worker_cond, &sched_mutex);
} }
...@@ -208,7 +208,7 @@ void ...@@ -208,7 +208,7 @@ void
yieldCapability(Capability* cap) yieldCapability(Capability* cap)
{ {
IF_DEBUG(scheduler, IF_DEBUG(scheduler,
sched_belch("worker thread (%d): giving up RTS token\n", osThreadId())); fprintf(stderr,"worker thread (%ld): giving up RTS token\n", osThreadId()));
releaseCapability(cap); releaseCapability(cap);
RELEASE_LOCK(&sched_mutex); RELEASE_LOCK(&sched_mutex);
yieldThread(); yieldThread();
......
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