# HG changeset patch # User jbe # Date 1497178398 -7200 # Node ID 76bede490cdff8359c6d79d7931a3bab2e9f2d4b # Parent 524bb61496b544f495baae51e77f18e320a7d4b6 Fixed documentation of moonbridge_io.poll(...) diff -r 524bb61496b5 -r 76bede490cdf reference.txt --- a/reference.txt Sun Jun 11 03:50:28 2017 +0200 +++ b/reference.txt Sun Jun 11 12:53:18 2017 +0200 @@ -401,27 +401,20 @@ If the 4th parameter (wakeup_on_sigterm) is set to true, then the function returns immediately if the process received at least one SIGTERM signal after -moonbridge_io.catch_sigterm() has been called for the first time. - -The function returns true when at least one file descriptor or handle is ready -for reading or writing respectively. The function may also return true (for -technical reasons) if signals other than SIGTERM have been received during -waiting. +moonbridge_io.catch_sigterm() has been called for the first time. Three values +are returned if a timeout happened or a SIGTERM has been received: false as +first return value, a message string as second return value (that may, for +example, be used for assert(...)), and a boolean as third return value which +indicates whether the function prematurely returned because of SIGTERM. If the 4th parameter (wakeup_on_sigterm) is omitted or set to false, then the function only returns false as first return value if a timeout happened. In -this case, the second return value will be set to an appropriate message string -such that assert(moonbridge_io.poll(...)) can be used to throw an error. +this case, the second return value also will be set to an appropriate message +string such that assert(moonbridge_io.poll(...)) can be used to throw an error. -If the 4th parameter (wakeup_on_sigterm) is set to true, then three values are -returned if a timeout happened or a SIGTERM has been received: false as first -return value, a message string as second return value (that may, for example, -be used for assert(...)), and a boolean as third return value which indicates -whether the function prematurely returned because of SIGTERM. - -this case a corresponding message will be provided as second return value such -that it is possible to call assert(moonbride_io.poll(...)) to raise an error if -a timeout occurs. +In all other cases, the function returns true as a single return value. The +function may also return true (for technical reasons) if signals other than +SIGTERM have been received during waiting. Note that the function is not thread-safe when the 4th parameter is set to true.