aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2026-02-27 10:59:11 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2026-02-27 10:59:11 +0100
commit7e4b6e1526c5b2f85079df6a6ecfe08244a7dbcc (patch)
tree3efb69b5a2d40fd1c226b72f3d0f99dcc30afc83 /docs
parent68355c7dd6bef53d264eca53567df9fb9c8684b6 (diff)
downloadlanes-7e4b6e1526c5b2f85079df6a6ecfe08244a7dbcc.tar.gz
lanes-7e4b6e1526c5b2f85079df6a6ecfe08244a7dbcc.tar.bz2
lanes-7e4b6e1526c5b2f85079df6a6ecfe08244a7dbcc.zip
Unify sleep() timeout with send() and receive (nil means forever)v4.0.0
Diffstat (limited to 'docs')
-rw-r--r--docs/index.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/index.html b/docs/index.html
index c9a85ac..a36119e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -218,7 +218,7 @@
218 <li> 218 <li>
219 Inside the lane 219 Inside the lane
220 <ul> 220 <ul>
221 <li><tt>cancel_test()</tt>: check for cancellation requests</li> 221 <li><tt>cancel_test()</tt>: check for <a href="#cancelling">cancellation</a> requests</li>
222 <li><tt>lane_threadname()</tt>: read or change the name of the thread</li> 222 <li><tt>lane_threadname()</tt>: read or change the name of the thread</li>
223 <li><tt>set_finalizer()</tt>: install a function called when the lane exits</li> 223 <li><tt>set_finalizer()</tt>: install a function called when the lane exits</li>
224 </ul> 224 </ul>
@@ -226,7 +226,7 @@
226 <li> 226 <li>
227 Given some <a href="#lindas">linda</a> <tt>l</tt> 227 Given some <a href="#lindas">linda</a> <tt>l</tt>
228 <ul> 228 <ul>
229 <li><tt>l:cancel()</tt>: mark a <a href="#lindas">linda</a> for cancellation</li> 229 <li><tt>l:cancel()</tt>: mark a <a href="#lindas">linda</a> for <a href="#cancelling">cancellation</a></li>
230 <li><tt>l:collectgarbage()</tt>: trigger a GC cycle in the <a href="#lindas">linda</a>'s Keeper state</li> 230 <li><tt>l:collectgarbage()</tt>: trigger a GC cycle in the <a href="#lindas">linda</a>'s Keeper state</li>
231 <li><tt>l:deep()</tt>: obtain a light userdata uniquely representing the <a href="#lindas">linda</a></li> 231 <li><tt>l:deep()</tt>: obtain a light userdata uniquely representing the <a href="#lindas">linda</a></li>
232 <li><tt>l:dump()</tt>: have information about slot contents</li> 232 <li><tt>l:dump()</tt>: have information about slot contents</li>
@@ -452,8 +452,8 @@
452 Sets the default period in seconds a <a href="#lindas">linda</a> will wake by itself during blocked operations. Default is never.<br /> 452 Sets the default period in seconds a <a href="#lindas">linda</a> will wake by itself during blocked operations. Default is never.<br />
453 When a <a href="#lindas">linda</a> enters a blocking call (<tt>send()</tt>, <tt>receive()</tt>, <tt>receive_batched()</tt>, <tt>sleep()</tt>), it normally sleeps either until the operation completes 453 When a <a href="#lindas">linda</a> enters a blocking call (<tt>send()</tt>, <tt>receive()</tt>, <tt>receive_batched()</tt>, <tt>sleep()</tt>), it normally sleeps either until the operation completes
454 or the specified timeout expires. With this setting, the default behavior can be changed to wake periodically. This can help for example with timing issues where a lane is signalled 454 or the specified timeout expires. With this setting, the default behavior can be changed to wake periodically. This can help for example with timing issues where a lane is signalled
455 for cancellation, but a <a href="#lindas">linda</a> inside the lane was in the middle of processing an operation but did not actually start the wait. This can result in the signal to be ignored, thus 455 for <a href="#cancelling">cancellation</a>, but a <a href="#lindas">linda</a> inside the lane was in the middle of processing an operation but did not actually start the wait. This can result in the signal to be ignored, thus
456 causing the <a href="#lindas">linda</a> to wait out the full operation timeout before cancellation is processed. 456 causing the <a href="#lindas">linda</a> to wait out the full operation timeout before <a href="#cancelling">cancellation</a> is processed.
457 </td> 457 </td>
458 </tr> 458 </tr>
459 459
@@ -499,7 +499,7 @@
499 </td> 499 </td>
500 <td> 500 <td>
501 Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Default is <tt>0.25</tt>.<br /> 501 Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Default is <tt>0.25</tt>.<br />
502 Lanes signals all lanes for cancellation with <tt>"soft"</tt>, <tt>"hard"</tt>, and <tt>"all"</tt> modes, in that order. Each attempt has <tt>shutdown_timeout</tt> seconds to succeed before the next one.<br /> 502 Lanes signals all lanes for <a href="#cancelling">cancellation</a> with <tt>"soft"</tt>, <tt>"hard"</tt>, and <tt>"all"</tt> modes, in that order. Each attempt has <tt>shutdown_timeout</tt> seconds to succeed before the next one.<br />
503 Then there is a last chance at cleanup with <a href="#finally"><tt>lanes.finally()</tt></a>. If some lanes are still running after that point, shutdown will either freeze or throw. It is YOUR responsibility to cleanup properly after yourself. 503 Then there is a last chance at cleanup with <a href="#finally"><tt>lanes.finally()</tt></a>. If some lanes are still running after that point, shutdown will either freeze or throw. It is YOUR responsibility to cleanup properly after yourself.
504 IMPORTANT: If there are still running lanes at shutdown, an error is raised, which will be propagated by Lua to the handler installed by <tt>lua_setwarnf</tt>. If the finalizer returned a value, this will be used as the error message.<br /> 504 IMPORTANT: If there are still running lanes at shutdown, an error is raised, which will be propagated by Lua to the handler installed by <tt>lua_setwarnf</tt>. If the finalizer returned a value, this will be used as the error message.<br />
505 LANES SHUTDOWN WILL NOT BE COMPLETE IN THAT CASE, AND THE SUBSEQUENT CONSEQUENCES ARE UNDEFINED! 505 LANES SHUTDOWN WILL NOT BE COMPLETE IN THAT CASE, AND THE SUBSEQUENT CONSEQUENCES ARE UNDEFINED!
@@ -1561,7 +1561,7 @@
1561<p> 1561<p>
1562 <tt>get()</tt> can read several values at once, and does not block. Return values ares: 1562 <tt>get()</tt> can read several values at once, and does not block. Return values ares:
1563 <ul> 1563 <ul>
1564 <li><tt>nil, lanes.cancel_error</tt> in case of cancellation.</li> 1564 <li><tt>nil, lanes.cancel_error</tt> in case of <a href="#cancelling">cancellation</a>.</li>
1565 <li><tt>number, val...</tt> where number is the actual count of items obtained from the linda (can be 0).</li> 1565 <li><tt>number, val...</tt> where number is the actual count of items obtained from the linda (can be 0).</li>
1566 </ul> 1566 </ul>
1567</p> 1567</p>
@@ -1768,12 +1768,12 @@
1768</p> 1768</p>
1769 1769
1770<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> 1770<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre>
1771 nil, "timeout" = lanes.sleep(['indefinitely'|seconds|nil]) 1771 nil, "timeout" = lanes.sleep([seconds|nil])
1772</pre></td></tr></table> 1772</pre></td></tr></table>
1773 1773
1774<p> 1774<p>
1775 A very simple way of sleeping when nothing else is available. Is implemented by attempting to read some data in an unused channel of the internal <a href="#lindas">linda</a> used for timers (this <a href="#lindas">linda</a> exists even when timers aren't enabled). 1775 A very simple way of sleeping when nothing else is available. Is implemented by attempting to read some data in an unused channel of the internal <a href="#lindas">linda</a> used for timers (this <a href="#lindas">linda</a> exists even when timers aren't enabled).
1776 Default duration is 0, which should only cause a thread context switch.<br /> 1776 Passing <tt>nil</tt> or no argument sleeps indefinitely (until <a href="#cancelling">cancellation</a> is received). Passing a non-negative number sleeps for that many seconds.<br />
1777 Return values should always be <tt>nil, "timeout"</tt> (or <tt>nil, lanes.cancel_error</tt> in case of interruption). 1777 Return values should always be <tt>nil, "timeout"</tt> (or <tt>nil, lanes.cancel_error</tt> in case of interruption).
1778</p> 1778</p>
1779 1779
@@ -2138,13 +2138,13 @@ static MyDeepFactory g_MyDeepFactory;
2138<h3 id="cancelling_cancel">Cancelling cancel</h3> 2138<h3 id="cancelling_cancel">Cancelling cancel</h3>
2139 2139
2140<p> 2140<p>
2141 Cancellation of lanes uses the Lua error mechanism with a special lightuserdata error sentinel. 2141 <a href="#cancelling">Cancellation</a> of lanes uses the Lua error mechanism with a special lightuserdata error sentinel.
2142 If you use <tt>pcall</tt> in code that needs to be cancellable from the outside, the special error might not get through to Lanes, thus preventing the lane from being cleanly cancelled. 2142 If you use <tt>pcall</tt> in code that needs to be cancellable from the outside, the special error might not get through to Lanes, thus preventing the lane from being cleanly cancelled.
2143 You should throw any lightuserdata error further. 2143 You should throw any lightuserdata error further.
2144</p> 2144</p>
2145 2145
2146<p> 2146<p>
2147 This system can actually be used by application to detect cancel, do your own cancellation duties, and pass on the error so Lanes will get it. If it does not get a clean cancellation from a lane in due time, it may forcefully kill the lane. 2147 This system can actually be used by application to detect cancel, do your own <a href="#cancelling">cancellation</a> duties, and pass on the error so Lanes will get it. If it does not get a clean cancellation from a lane in due time, it may forcefully kill the lane.
2148</p> 2148</p>
2149 2149
2150<p> 2150<p>