System.SyncObjs.TCriticalSection.TryEnter
Delphi
function TryEnter: Boolean;
C++
bool __fastcall TryEnter();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SyncObjs.pas System.SyncObjs.hpp |
System.SyncObjs | TCriticalSection |
Description
Tries to enter a critical section.
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.