Enhancement: Removed lock from atomic thread safe checks
Enhancement: Added preliminary checks before locking for better
performance