-
Why not let the program do its own locking if it needs it? Numbers are used a lot, and opening/closing a lock for every single operation would be pretty expensive.
Locking as close to the resource as possible is easier and usually safer (less chance of missing something) than locking at a higher level, but it's much more resource intensive.
-
Hence the provided functions for locking/unlocking and a macro to do the dirt work so you don't have to bother writing your own code if you don't need it.
It could even work as a locking resource if the integer/float is going to be changed during the "update" or whatever it is the code is supposed to be doing.