Commit 8b48562e authored by Simon Marlow's avatar Simon Marlow
Browse files

Define getNumberOfProcessors() even when !THREADED_RTS

parent eea40328
......@@ -183,8 +183,7 @@ extern void initCondition ( Condition* pCond );
extern void closeCondition ( Condition* pCond );
extern rtsBool broadcastCondition ( Condition* pCond );
extern rtsBool signalCondition ( Condition* pCond );
extern rtsBool waitCondition ( Condition* pCond,
Mutex* pMut );
extern rtsBool waitCondition ( Condition* pCond, Mutex* pMut );
//
// Mutexes
......@@ -201,7 +200,6 @@ void setThreadLocalVar (ThreadLocalKey *key, void *value);
void freeThreadLocalKey (ThreadLocalKey *key);
// Processors and affinity
nat getNumberOfProcessors (void);
void setThreadAffinity (nat n, nat m);
#endif // !CMINUSMINUS
......@@ -213,12 +211,17 @@ void setThreadAffinity (nat n, nat m);
#endif /* defined(THREADED_RTS) */
#ifndef CMINUSMINUS
//
// Support for forkOS (defined regardless of THREADED_RTS, but does
// nothing when !THREADED_RTS).
//
#ifndef CMINUSMINUS
int forkOS_createThread ( HsStablePtr entry );
//
// Returns the number of processor cores in the machine
//
nat getNumberOfProcessors (void);
#endif
#endif /* RTS_OSTHREADS_H */
......@@ -850,6 +850,7 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(stg_readTVarIOzh) \
SymI_HasProto(resumeThread) \
SymI_HasProto(setNumCapabilities) \
SymI_HasProto(getNumberOfProcessors) \
SymI_HasProto(resolveObjs) \
SymI_HasProto(stg_retryzh) \
SymI_HasProto(rts_apply) \
......
......@@ -308,4 +308,9 @@ forkOS_createThread ( HsStablePtr entry STG_UNUSED )
return -1;
}
#endif /* !defined(THREADED_RTS) */
nat getNumberOfProcessors (void)
{
return 1;
}
#endif
......@@ -308,4 +308,9 @@ forkOS_createThread ( HsStablePtr entry STG_UNUSED )
return -1;
}
nat getNumberOfProcessors (void)
{
return 1;
}
#endif /* !defined(THREADED_RTS) */
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