Skip to content

Commit f757ca2

Browse files
author
Vladimir I
committed
Fix gh-830
Summirized the cancelled status issues in one NOTE and changed an example in fiber:cancel() description. Also depended with #831 and #829
1 parent 5777628 commit f757ca2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

doc/1.10/reference/reference_lua/fiber.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,12 @@ recommended.
399399

400400
.. NOTE::
401401

402-
This exception cannot be caught by pcall or xpcall.
402+
Even if you catch the exception, the fiber will stay cancelled.
403+
Most type of calls will check for cancelled status of a fiber and
404+
return an error.
405+
However, some function (id, status, join) will not return error.
406+
It is recommended to develop your applications in such way, that
407+
cancelled fibers will stop executing and end as soon as possible.
403408

404409
**Example:**
405410

@@ -515,7 +520,7 @@ recommended.
515520

516521
Cancel a fiber. Running and suspended fibers can be cancelled.
517522
After a fiber has been cancelled, attempts to operate on it will
518-
cause errors, for example :ref:`fiber_object:id() <fiber_object-id>`
523+
cause errors, for example :ref:`fiber_object:name() <fiber_object-name_get>`
519524
will cause ``error: the fiber is dead``.
520525

521526
:param fiber_object: generally this is an object referenced in the return

0 commit comments

Comments
 (0)