--- Coro/README 2017/07/14 13:14:32 1.39 +++ Coro/README 2017/08/31 16:28:49 1.40 @@ -653,8 +653,8 @@ Returns true iff this Coro object has been suspended. Suspended Coros will not ever be scheduled. - $coro->cancel (arg...) - Terminates the given Coro thread and makes it return the given + $coro->cancel ($arg...) + Terminate the given Coro thread and make it return the given arguments as status (default: an empty list). Never returns if the Coro is the current Coro. @@ -699,13 +699,18 @@ method, and therefore, it might fail. It is also considerably slower than "cancel" or "terminate". - A thread is in a safe-cancellable state if it either hasn't been run - yet, or it has no C context attached and is inside an SLF function. - - The latter two basically mean that the thread isn't currently inside - a perl callback called from some C function (usually via some XS - modules) and isn't currently executing inside some C function itself - (via Coro's XS API). + A thread is in a safe-cancellable state if it either has never been + run yet, has already been canceled/terminated or otherwise + destroyed, or has no C context attached and is inside an SLF + function. + + The first two states are trivial - a thread that hasnot started or + has already finished is safe to cancel. + + The last state basically means that the thread isn't currently + inside a perl callback called from some C function (usually via some + XS modules) and isn't currently executing inside some C function + itself (via Coro's XS API). This call returns true when it could cancel the thread, or croaks with an error otherwise (i.e. it either returns true or doesn't