Greetings,

Could someone please provide me an example of how to create a synchronized 
function? The docs provide this:
js> function test(x) {
  print("entry");
  java.lang.Thread.sleep(x*1000);
  print("exit");
}
js> var o = { f : sync(test) };
js> spawn(function() {o.f(5);});
Thread[Thread-0,5,main]
entry
js> spawn(function() {o.f(5);});

However, the sync(test) line gives me an exception: 
org.mozilla.javascript.EcmaError: ReferenceError: "sync" is not defined.

/Chris 


_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to