From 9b24577be41e2933bcb0bace0be85374dbf216c5 Mon Sep 17 00:00:00 2001
From: Benoit Germain <benoit.germain@ubisoft.com>
Date: Mon, 20 May 2024 11:57:53 +0200
Subject: Restore linda:limit(0), it was a mistake

---
 src/linda.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/linda.cpp b/src/linda.cpp
index 4086211..8ec167d 100644
--- a/src/linda.cpp
+++ b/src/linda.cpp
@@ -486,7 +486,7 @@ LUAG_FUNC(linda_receive)
 /*
  * [true|lanes.cancel_error] = linda_set( linda_ud, key_num|str|bool|lightuserdata [, value [, ...]])
  *
- * Set one or more value to Linda.
+ * Set one or more value to Linda. Ignores limits.
  *
  * Existing slot value is replaced, and possible queued entries removed.
  */
@@ -594,6 +594,7 @@ LUAG_FUNC(linda_get)
  *
  * Set limit to 1 Linda keys.
  * Optionally wake threads waiting to write on the linda, in case the limit enables them to do so
+ * Limit can be 0 to completely block everything
  */
 LUAG_FUNC(linda_limit)
 {
@@ -604,7 +605,7 @@ LUAG_FUNC(linda_limit)
         // make sure we got a numeric limit
         lua_Number const _limit{ luaL_checknumber(L_, 3) };
         if (_limit < 1) {
-            raise_luaL_argerror(L_, 3, "limit must be >= 1");
+            raise_luaL_argerror(L_, 3, "limit must be >= 0");
         }
         // make sure the key is of a valid type
         check_key_types(L_, 2, 2);
-- 
cgit v1.2.3-55-g6feb