Can we read / update boolean value safely from difference thread?

  

Can we read / update boolean value safely from difference thread ? I mean is the operation atomic ? I want to know this for all platforms (android, ios, macos, linux, windows)

What i want to do is to use a boolean var as a flag. something like :

var isempty: boolean;

::thread x
if not isempty then begin …. isempty := true; end;

::thread y
isempty := false:

Comments are closed.