RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCriticalSection.TryEnter Method

Tries to enter a critical section.

Pascal
function TryEnter: Boolean;
C++
__fastcall Boolean TryEnter();

Call TryEnter to block all the other threads from entering the code that is protected by this critical section until the Leave or Release methods are called.  

TryEnter does not wait for other threads to leave the critical section. True is returned on success; False is returned if the section is acquired by another thread. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!