#include <concurrency_checker.h>
Public Member Functions | |
AZ_FORCE_INLINE void | soft_lock () |
AZ_FORCE_INLINE void | soft_unlock () |
AZ_FORCE_INLINE void | soft_lock_shared () |
AZ_FORCE_INLINE void | soft_unlock_shared () |
Simple class for verifying that no concurrent access is occurring. This is not a synchronization primitive, and is intended simply for checking that no concurrency issues exist. It will be compiled out in release builds. Use concurrency_checker like a mutex (i.e. call soft_lock() and soft_unlock() around all instances of your data access). Use soft_lock_shared and soft_unlock_shared around places where multiple threads are allowed to have read access at the same time as long as nothing else already has a soft lock It will assert if there are multiple threads accessing the locked code/data at the same time. Expected use case is for defensive programming: when you do not expect any concurrent access within a system, but want to verify that it stays that way in the future, without incurring the overhead of a mutex.