I see that the atomic_flag is guaranteed to be lock free. A atomic boolean is not.
I'm trying to get an understanding when one should be used over the other. If one uses the atomic boolean should a is lock free check be performed? Should the class member functions be used over using an assignment?