Re: synchronized confusion...

2013-04-16 Thread estewh
Hi Ali, Thanks for the help, looks like synchronized blocks are what I want. I just found your book online the other day too, nice work! Cheers, Stewart

Re: synchronized confusion...

2013-04-16 Thread Ali Çehreli
On 04/15/2013 11:06 PM, estewh wrote: > Hi All, > > I have this bit of code like this: > > shared bool varInitialized = false; > bool initVar() { > bool ret; > synchronized { ret = varInitialized;} > return ret; > } > > I know there are atomics and I am using them but I am curious abo

synchronized confusion...

2013-04-15 Thread estewh
Hi All, I have this bit of code like this: shared bool varInitialized = false; bool initVar() { bool ret; synchronized { ret = varInitialized;} return ret; } I know there are atomics and I am using them but I am curious about the above code. It compiles but I have no idea how safe it