api: threads, events

This commit is contained in:
hyb1996
2017-12-28 21:21:41 +08:00
parent 729958d419
commit 3647cef81b
13 changed files with 394 additions and 34 deletions

View File

@@ -0,0 +1,12 @@
module.exports = function(__runtime__, scope){
var threads = Object.create(__runtime__.threads);
scope.sync = function(func, lock){
lock = lock || null;
return new org.mozilla.javascript.Synchronizer(func, lock);
}
return threads;
}