Hi,

I am trying to use await with an async operation as in the attached code. The 
code compiles, but it simply waits infinitely at the await statement.
I am most probably doing something strange, and await is not expected to work 
like this?

Let me know if any of you have tried using await for such scenario.

Thanks and Cheers
Ganesh
 

-----------------------------------------------------
public class test {
   class Incrementor {
        var i:Int;
        var incremented:Boolean;

        public def this() {
            i = 0;
            incremented = false;
        }

        public def increment() {
            Console.OUT.println("Entering increment(): " + incremented);

            i++;
            incremented = true;

            Console.OUT.println("Leaving increment(): " + incremented);
        }
    }

    def func() {
        val inc = new Incrementor();

        async inc.increment();
        await inc.incremented;

        Console.OUT.println("Its done: " + inc.i);
    }

    public static def main(args:Rail[String]) {
       (new test()).func();
    }
}
-----------------------------------------------------


 In the beginning there was nothing. God said, 'Let there be light!' And there 
was light. There was still nothing, but you could see it a whole lot better.
- Ellen DeGeneres



      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to