summaryrefslogtreecommitdiff
path: root/rts/Pool.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-11-26 12:02:33 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-26 14:48:48 +0100
commitc4308b468c7fe723b6f0a1009b233a55260de503 (patch)
treee1bd38e290aa9700d59b4393bba15e721f4a6f71 /rts/Pool.h
parentd2a2d5ebb08caedcd2a2a7a9e06ed6f4cbba96e7 (diff)
downloadhaskell-c4308b468c7fe723b6f0a1009b233a55260de503.tar.gz
rts/Pool: Add poolTryTake
Diffstat (limited to 'rts/Pool.h')
-rw-r--r--rts/Pool.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/rts/Pool.h b/rts/Pool.h
index d1aeab5661..dd00412d27 100644
--- a/rts/Pool.h
+++ b/rts/Pool.h
@@ -43,7 +43,15 @@ void poolSetDesiredSize(Pool *pool, nat size);
/* Get the desired size of a pool */
nat poolGetDesiredSize(Pool *pool);
-/* Grab an available thing from a pool */
+/* Try to grab an available thing from a pool, returning NULL if no things
+ * are available.
+ */
+void *poolTryTake(Pool *pool);
+
+/* Grab an available thing from a pool. This will block if no elements are
+ * available in the case of a threaded runtime or abort in a single-threaded
+ * environment.
+ */
void *poolTake(Pool *pool);
/* Release a thing back to the pool from which it was taken */