diff options
Diffstat (limited to 'test/test_llthreads.lua')
| -rw-r--r-- | test/test_llthreads.lua | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/test/test_llthreads.lua b/test/test_llthreads.lua index 3474b9b..df8c6a2 100644 --- a/test/test_llthreads.lua +++ b/test/test_llthreads.lua | |||
| @@ -19,29 +19,7 @@ | |||
| 19 | -- THE SOFTWARE. | 19 | -- THE SOFTWARE. |
| 20 | 20 | ||
| 21 | local llthreads = require"llthreads" | 21 | local llthreads = require"llthreads" |
| 22 | 22 | local sleep = require"utils".sleep | |
| 23 | local sleep | ||
| 24 | local status, socket = pcall(require,"socket") | ||
| 25 | if status then | ||
| 26 | sleep = function(secs) | ||
| 27 | return socket.sleep(secs) | ||
| 28 | end | ||
| 29 | end | ||
| 30 | |||
| 31 | if not sleep then | ||
| 32 | local status, ztimer = pcall(require, "lzmq.timer") | ||
| 33 | if status then | ||
| 34 | sleep = function(secs) | ||
| 35 | ztimer.sleep(secs * 1000) | ||
| 36 | end | ||
| 37 | end | ||
| 38 | end | ||
| 39 | |||
| 40 | if not sleep then | ||
| 41 | sleep = function(secs) | ||
| 42 | os.execute("sleep " .. tonumber(secs)) | ||
| 43 | end | ||
| 44 | end | ||
| 45 | 23 | ||
| 46 | local function detached_thread(...) | 24 | local function detached_thread(...) |
| 47 | local thread = llthreads.new([[ print("print_detached_thread:", ...) ]], ...) | 25 | local thread = llthreads.new([[ print("print_detached_thread:", ...) ]], ...) |
