diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-04-23 14:27:00 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-04-23 14:27:00 +0200 |
commit | efb81b501adbbddf25615bbcc216bbbf3a3c8e0a (patch) | |
tree | 5f354dfeee836ef78c0935cc2d0ec66e6276151c /docs/index.html | |
parent | 7eb03175d19fca48ac915fc03c352e0d429bc37e (diff) | |
download | lanes-efb81b501adbbddf25615bbcc216bbbf3a3c8e0a.tar.gz lanes-efb81b501adbbddf25615bbcc216bbbf3a3c8e0a.tar.bz2 lanes-efb81b501adbbddf25615bbcc216bbbf3a3c8e0a.zip |
cancel_test() returns "soft"/"hard" instead of true
Diffstat (limited to 'docs/index.html')
-rw-r--r-- | docs/index.html | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/docs/index.html b/docs/index.html index e3e8c7a..e3fbd0b 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -71,7 +71,7 @@ | |||
71 | </p> | 71 | </p> |
72 | 72 | ||
73 | <p> | 73 | <p> |
74 | This document was revised on 21-Apr-25, and applies to version <tt>4.0.0</tt>. | 74 | This document was revised on 23-Apr-25, and applies to version <tt>4.0.0</tt>. |
75 | </p> | 75 | </p> |
76 | </font> | 76 | </font> |
77 | </center> | 77 | </center> |
@@ -215,6 +215,7 @@ | |||
215 | <li> | 215 | <li> |
216 | Inside the lane | 216 | Inside the lane |
217 | <ul> | 217 | <ul> |
218 | <li><tt>cancel_test()</tt>: check for cancellation requests</li> | ||
218 | <li><tt>lane_threadname()</tt>: read or change the name of the thread</li> | 219 | <li><tt>lane_threadname()</tt>: read or change the name of the thread</li> |
219 | <li><tt>set_finalizer()</tt>: install a function called when the lane exits</li> | 220 | <li><tt>set_finalizer()</tt>: install a function called when the lane exits</li> |
220 | </ul> | 221 | </ul> |
@@ -1222,26 +1223,36 @@ | |||
1222 | First argument is a <tt>mode</tt>. It can be one of: | 1223 | First argument is a <tt>mode</tt>. It can be one of: |
1223 | <ul> | 1224 | <ul> |
1224 | <li> | 1225 | <li> |
1225 | <tt>"soft"</tt>: Cancellation will only cause <tt>cancel_test()</tt> to return <tt>true</tt>, so that the lane can cleanup manually. | 1226 | <tt>"soft"</tt>: Cancellation will only cause <tt>cancel_test()</tt> to return <tt>"soft"</tt>, so that the lane can cleanup manually. |
1226 | <br /> | 1227 | <br /> |
1227 | Lindas will also check for cancellation inside blocking calls to early out based on their <tt>wake_period</tt>. | 1228 | Lindas will also check for cancellation inside blocking calls to early out based on their <tt>wake_period</tt>. |
1228 | </li> | 1229 | </li> |
1229 | <li> | 1230 | <li> |
1230 | <tt>"hard"</tt>: waits for the request to be processed, or a timeout to occur. <a href="#lindas">linda</a> operations detecting the cancellation request will raise a special cancellation error (meaning they won't return in that case).<br /> | 1231 | <tt>"hard"</tt>: waits for the request to be processed, or a timeout to occur. <a href="#lindas">linda</a> operations detecting the cancellation request will raise a special cancellation error (meaning they won't return in that case). |
1232 | <br /> | ||
1233 | If the lane isn't actually waiting on a Linda when the request is issued, a lane calling <tt>cancel_test()</tt> will see it return <tt>"hard"</tt>. | ||
1234 | <br /> | ||
1231 | <tt>wake_lane</tt> defaults to <tt>true</tt>, and <tt>timeout</tt> defaults to 0 if not specified. | 1235 | <tt>wake_lane</tt> defaults to <tt>true</tt>, and <tt>timeout</tt> defaults to 0 if not specified. |
1232 | </li> | 1236 | </li> |
1233 | <li> | 1237 | <li> |
1234 | <tt>"call"</tt>, <tt>"ret"</tt>, <tt>"line"</tt>, <tt>"count"</tt>: Asynchronously install the corresponding hook, then behave as <tt>"hard"</tt>. | 1238 | <tt>"call"</tt>, <tt>"ret"</tt>, <tt>"line"</tt>, <tt>"count"</tt>: Asynchronously install the corresponding hook, then behave as <tt>"hard"</tt>. |
1239 | <br /> | ||
1240 | If the lane has the opportunity to call <tt>cancel_test()</tt> before the hook is invoked, calling <tt>cancel_test()</tt> will see it return <tt>"hard"</tt>. | ||
1235 | </li> | 1241 | </li> |
1236 | <li> | 1242 | <li> |
1237 | <tt>"all"</tt>: Installs all hooks in one shot, just to be sure. | 1243 | <tt>"all"</tt>: Installs all hooks in one shot, just to be sure. |
1238 | </li> | 1244 | </li> |
1239 | </ul> | 1245 | </ul> |
1240 | If <tt>mode</tt> is not specified, it defaults to <tt>"hard"</tt>. | 1246 | <p> |
1247 | If <tt>mode</tt> is not specified, it defaults to <tt>"hard"</tt>. | ||
1248 | </p> | ||
1249 | </p> | ||
1250 | <p> | ||
1241 | If <tt>wake_lane</tt> is <tt>true</tt>, the lane is also signalled so that execution returns from any pending <a href="#lindas">linda</a> operation. <a href="#lindas">linda</a> operations detecting the cancellation request return <tt>lanes.cancel_error</tt>. | 1251 | If <tt>wake_lane</tt> is <tt>true</tt>, the lane is also signalled so that execution returns from any pending <a href="#lindas">linda</a> operation. <a href="#lindas">linda</a> operations detecting the cancellation request return <tt>lanes.cancel_error</tt>. |
1242 | </p> | 1252 | </p> |
1243 | <tt>timeout</tt> is an optional number >= 0. Defaults to infinite if left unspecified or <tt>nil</tt>. | 1253 | <p> |
1244 | <br /> | 1254 | <tt>timeout</tt> is an optional number >= 0. Defaults to infinite if left unspecified or <tt>nil</tt>. |
1255 | </p> | ||
1245 | <p> | 1256 | <p> |
1246 | If the lane is still running after the timeout expired, there is a chance lanes will freeze forever at shutdown when failing to terminate all free-running lanes within the specified timeout. | 1257 | If the lane is still running after the timeout expired, there is a chance lanes will freeze forever at shutdown when failing to terminate all free-running lanes within the specified timeout. |
1247 | </p> | 1258 | </p> |