The Definitive Guide to atomic
EDIT: As identified effectively by Bo Persson, the copy Procedure performed because of the wrapper isn't atomic. It lets you copy atomic objects, even so the duplicate itself just isn't atomic.If you really mean to make use of a global variable with the atomic, the proper (and speediest) code that does what your 1st code block attempts is:Run by it