summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/src/thread_nextTick.ls
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webworker-threads/src/thread_nextTick.ls')
-rw-r--r--node_modules/webworker-threads/src/thread_nextTick.ls19
1 files changed, 19 insertions, 0 deletions
diff --git a/node_modules/webworker-threads/src/thread_nextTick.ls b/node_modules/webworker-threads/src/thread_nextTick.ls
new file mode 100644
index 0000000..7ac3fe2
--- /dev/null
+++ b/node_modules/webworker-threads/src/thread_nextTick.ls
@@ -0,0 +1,19 @@
+function ThreadNextTick
+ function next-tick (cb)
+ thread._ntq.push cb
+ return this
+ function dispatch-next-ticks (l, p, err, _ntq)
+ if l = (_ntq = thread._ntq).length
+ p = err = 0
+ try
+ while true
+ _ntq[p]!
+ break unless ++p < l
+ catch e
+ thread._ntq = _ntq.slice ++p
+ throw e
+ return (thread._ntq = _ntq.slice p).length
+ return 0
+ thread._ntq = []
+ thread.next-tick = next-tick
+ return dispatch-next-ticks