On Do, 2012-05-24 at 13:46 +0200, tobias.lan...@informatik.stud.uni-erlangen.de wrote: > Hi dear List, > > I'm pretty new to X10, so please excuse if I have some errors in my > understanding of it. > > I'm trying to do some message logging in the X10 Runtime that exceed the > features already implemented in Runtime.x10. > Therefore I implemented a own Logger class in X10 (the Logger works as a > Singleton object) and put it into the src-x10/x10/lang folder. > It basically works like that: > > public class Logger { > ... > private static logger = new Logger(); > public static def getInstance() = logger; > ... > var msgSent: Int = 0; > public def newMsg() > { > msgSent++; > } > ... > } > > Whenever now a message is sent in the method run_async_at of the file > src-cpp/x10aux/network.cc/h, the method newMsg() is called. > My problem here is: After the call of the function newMsg the value of > msgSent is reset to it's initialized value (I already tried instead of > initializing it with 0 to initialize it with 4...) and I can't imagine > why. I guess due to the copy semantics of at (ยง13.3.2), your are working on a copy.
Best regards, Sebastian ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users