setFlag

Atomically replace the given flag with the boolean.