critical_section::lock Method

Acquires this critical section.

void lock();


It is often safer to utilize the scoped_lock construct to acquire and release a critical_section object in an exception safe way.

If the lock is already held by the calling context, an improper_lock exception will be thrown.


Header: concrt.h

Namespace: concurrency

See Also


critical_section Class

critical_section::unlock Method

critical_section::scoped_lock Class