From c7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 Mon Sep 17 00:00:00 2001 From: yo mama Date: Sat, 4 Apr 2015 01:00:59 -0700 Subject: first --- node_modules/webworker-threads/src/thread_nextTick.ls | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 node_modules/webworker-threads/src/thread_nextTick.ls (limited to 'node_modules/webworker-threads/src/thread_nextTick.ls') 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 -- cgit v1.2.3-70-g09d2