Maybe. These operations are not simple enough to be atomic, so they will only be thread safe if the implementation explicitly performs the necessary lock.
However, the C ++ standard does not indicate whether these operations should be thread safe, so solving this problem depends on the particular implementation. Check documents. (Or tell us which implementation you are using)
jalf
source share