lock Class
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at lock Class.
This class automates taking a lock for synchronizing access to an object from multiple threads. When constructed it acquires the lock and when destroyed it releases the lock.
ref class lock;
lock is available only for CLR objects and can only be used in CLR code.
Internally, the lock class uses Monitor to synchronize access. See this topic for more detailed information on synchronization.
Header file <msclr\lock.h>
Namespace msclr
Show: