Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
8b48562e
Commit
8b48562e
authored
Dec 07, 2011
by
Simon Marlow
Browse files
Define getNumberOfProcessors() even when !THREADED_RTS
parent
eea40328
Changes
4
Hide whitespace changes
Inline
Side-by-side
includes/rts/OSThreads.h
View file @
8b48562e
...
...
@@ -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 */
rts/Linker.c
View file @
8b48562e
...
...
@@ -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) \
...
...
rts/posix/OSThreads.c
View file @
8b48562e
...
...
@@ -308,4 +308,9 @@ forkOS_createThread ( HsStablePtr entry STG_UNUSED )
return
-
1
;
}
#endif
/* !defined(THREADED_RTS) */
nat
getNumberOfProcessors
(
void
)
{
return
1
;
}
#endif
rts/win32/OSThreads.c
View file @
8b48562e
...
...
@@ -308,4 +308,9 @@ forkOS_createThread ( HsStablePtr entry STG_UNUSED )
return
-
1
;
}
nat
getNumberOfProcessors
(
void
)
{
return
1
;
}
#endif
/* !defined(THREADED_RTS) */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment