hi,

   i do this test.
from the result, it seems use one thread to sync two function. but why the result have one undefined msg...

must use spawn by many thread? if use many thread , how can i know if error in one thread...

thanks.

test example:

var obj = { thread1 : sync(f)};


function f(a, b) {

    java.lang.Thread.sleep(2000);
    print(a + ";" + b);

   var threadName = java.lang.Thread.currentThread().getName();
   var threadID = java.lang.Thread.currentThread().getId()
   print(threadID + "-" + threadName);


}

obj.thread1(f(1, 2));
obj.thread1(f(3, 4));



result:
1;2
1-main
undefined;undefined
1-main
3;4
1-main
undefined;undefined
1-main
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to