facebookarchive / libwit

Lib wit
Other
33 stars 19 forks source link

Use an AtomicUint for tracking logging verbosity #3

Closed reem closed 9 years ago

reem commented 9 years ago

This is safer than using a regular uint, as it eliminates the chance of undefined data races by reading/writing to the verbosity concurrently.

Since we don't care too much about the precise ordering of load/store instructions here, we can use the Relaxed ordering but still get atomic operations.

martinraison commented 9 years ago

Nice! Thanks a lot for catching this :)

reem commented 9 years ago

@martinraison Absolutely, glad I could contribute!