On Mon, Oct 18, 2010 at 10:21 AM, xeagle wrote:
> Hi,
>
> I use a boolean variable "flag" both in main and child thread. This
> "flag" is used to notify child thread to exit. I only use simple
> operation, e.g., "flag=false", "if (flag) {}". As I know, in java,
> "get and set a boolean variable" i
Hi,
I use a boolean variable "flag" both in main and child thread. This
"flag" is used to notify child thread to exit. I only use simple
operation, e.g., "flag=false", "if (flag) {}". As I know, in java,
"get and set a boolean variable" is atomic. So "synchronized" is not
needed for variable "flag
2 matches
Mail list logo