made all changes to task flags be done with macros
changed raise_flag and friends to be atomic