System.SyncObjs.TCriticalSection.TryEnter

From RAD Studio API Documentation
Jump to: navigation, search

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.

See Also