Commit fdb2b1fd authored by simonmar's avatar simonmar
Browse files

[project @ 2003-12-19 10:41:14 by simonmar]

Fix DEBUG & !RTS_SUPPORTS_THREADS build (bogus assertion failure)
parent fc13ed2f
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
Capability MainCapability; /* for non-SMP, we have one global capability */ Capability MainCapability; /* for non-SMP, we have one global capability */
#endif #endif
#if defined(RTS_SUPPORTS_THREADS)
nat rts_n_free_capabilities; nat rts_n_free_capabilities;
#if defined(RTS_SUPPORTS_THREADS)
/* returning_worker_cond: when a worker thread returns from executing an /* returning_worker_cond: when a worker thread returns from executing an
* external call, it needs to wait for an RTS Capability before passing * external call, it needs to wait for an RTS Capability before passing
* on the result of the call to the Haskell thread that made it. * on the result of the call to the Haskell thread that made it.
...@@ -107,15 +108,15 @@ static void initCapabilities_(nat n); ...@@ -107,15 +108,15 @@ static void initCapabilities_(nat n);
void void
initCapabilities( void ) initCapabilities( void )
{ {
#if defined(RTS_SUPPORTS_THREADS)
initCondition(&returning_worker_cond);
initCondition(&thread_ready_cond);
#endif
#if defined(SMP) #if defined(SMP)
initCapabilities_(RtsFlags.ParFlags.nNodes); initCapabilities_(RtsFlags.ParFlags.nNodes);
#else #else
initCapability(&MainCapability); initCapability(&MainCapability);
#endif
#if defined(RTS_SUPPORTS_THREADS)
initCondition(&returning_worker_cond);
initCondition(&thread_ready_cond);
rts_n_free_capabilities = 1; rts_n_free_capabilities = 1;
#endif #endif
...@@ -140,8 +141,10 @@ void ...@@ -140,8 +141,10 @@ void
grabCapability( Capability** cap ) grabCapability( Capability** cap )
{ {
#if !defined(SMP) #if !defined(SMP)
#if defined(RTS_SUPPORTS_THREADS)
ASSERT(rts_n_free_capabilities == 1); ASSERT(rts_n_free_capabilities == 1);
rts_n_free_capabilities = 0; rts_n_free_capabilities = 0;
#endif
*cap = &MainCapability; *cap = &MainCapability;
handleSignalsInThisThread(); handleSignalsInThisThread();
#else #else
......
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