Implements a scope lock. 更多...
#include <ScopeLock.h>
Public 成员函数 | |
| FScopeLock (FCriticalSection *InSynchObject) | |
| Constructor that performs a lock on the synchronization object 更多... | |
| ~FScopeLock () | |
| Destructor that performs a release on the synchronization object. | |
Implements a scope lock.
This is a utility class that handles scope level locking. It's very useful to keep from causing deadlocks due to exceptions being caught and knowing about the number of locks a given thread has on a resource. Example:
{ // Synchronize thread access to the following data FScopeLock ScopeLock(SynchObject); // Access data that is shared among multiple threads ... // When ScopeLock goes out of scope, other threads can access data }
|
inline |
Constructor that performs a lock on the synchronization object
| InSynchObject | The synchronization object to manage |