diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-07-21 14:42:32 -0700 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-27 04:49:00 -0400 |
commit | 0090517a8fccc0d6605e4b6d3d95568d91201d72 (patch) | |
tree | 61eeed903f8f06baeb6bcee941b0aa364c2311b7 /includes | |
parent | b19f1a6a541645b735e01aa2658f5493fb1cc97d (diff) | |
download | haskell-0090517a8fccc0d6605e4b6d3d95568d91201d72.tar.gz |
rts/OSThreads: Improve error handling consistency
Previously we relied on the caller to check the return value from
broadcastCondition and friends, most of whom neglected to do so. Given
that these functions should not fail anyways, I've opted to drop the
return value entirely and rather move the result check into the
OSThreads functions.
This slightly changes the semantics of timedWaitCondition which now
returns false only in the case of timeout, rather than any error as
previously done.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/OSThreads.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/rts/OSThreads.h b/includes/rts/OSThreads.h index b711036b17..08d90de06e 100644 --- a/includes/rts/OSThreads.h +++ b/includes/rts/OSThreads.h @@ -173,9 +173,10 @@ extern void joinOSThread ( OSThreadId id ); // extern void initCondition ( Condition* pCond ); extern void closeCondition ( Condition* pCond ); -extern bool broadcastCondition ( Condition* pCond ); -extern bool signalCondition ( Condition* pCond ); -extern bool waitCondition ( Condition* pCond, Mutex* pMut ); +extern void broadcastCondition ( Condition* pCond ); +extern void signalCondition ( Condition* pCond ); +extern void waitCondition ( Condition* pCond, Mutex* pMut ); +// Returns false on timeout, true otherwise. extern bool timedWaitCondition ( Condition* pCond, Mutex* pMut, Time timeout); // |