diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-04-04 01:00:59 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-04-04 01:00:59 -0700 |
| commit | c7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 (patch) | |
| tree | 8546df448afef40d3814d2581f4dacff7cebb87f /node_modules/webworker-threads/src/thread_nextTick.ls | |
Diffstat (limited to 'node_modules/webworker-threads/src/thread_nextTick.ls')
| -rw-r--r-- | node_modules/webworker-threads/src/thread_nextTick.ls | 19 |
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 |
