Class threads
Library for viewing Lua Thread Stats.
Functions
stats () | Print Lua Threads Stats to stdout. |
completed () | Returns the number of completed threads. |
yielded () | Returns the number of yielded threads. |
active () | Returns the number of active threads. |
errored () | Returns the number of errored threads. |
Functions
- stats ()
-
Print all current threads stats to stdout.
Usage:
threads.stats() - completed ()
-
Return the number of threads completed (status: OK).
Usage:
while( threads.complete() < num_threads ) do
  ...
endReturn value:
a non negative number value, representing threads completed at the time of the call - yielded ()
-
Return the number of threads in yielded state (status: SUSPENDED).
Usage:
if( threads.yielded() > 0 ) then
  ...
endReturn value:
a non negative number value, representing threads yeilded at the time of the callDemo:
See also:
- active ()
-
Return the number of threads in active state (status: WORKING).
Notice: active does not count yielded threadsUsage:
while( threads.active > 0 ) do
  wait ...
endReturn value:
a non negative number value, representing threads active at the time of the callSee also:
- errored ()
-
Return the number of threads in active state (status: WORKING).
Usage:
if( threads.errored > 0 ) then
  investigate ...
endReturn value:
a non negative number value, representing threads that errored before completion (status: ERRORED).