summaryrefslogtreecommitdiff
path: root/includes/rts/OSThreads.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-07-21 14:42:32 -0700
committerBen Gamari <ben@smart-cactus.org>2021-07-25 18:39:38 -0400
commit8ed5bcf70ad42677d6b01e35268d7a9609aa427a (patch)
tree90fd14b3494f4f6c21a9be36ce06b307badd2e7a /includes/rts/OSThreads.h
parent79794b3f1a604d46d1ea9835444fdc3997aedd10 (diff)
downloadhaskell-wip/osthread-fixes.tar.gz
rts/OSThreads: Improve error handling consistencywip/osthread-fixes
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/rts/OSThreads.h')
-rw-r--r--includes/rts/OSThreads.h7
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);
//