System.Win.ScktComp.TCustomWinSocket.Lock

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Lock;

C++

void __fastcall Lock();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TCustomWinSocket

Description

Starts a critical section, blocking all other execution threads until the Unlock method is called.

Call Lock before beginning a section of code that is not thread-safe. Call Unlock when the critical section of code is completed. Unless absolutely necessary, do not use Lock to lock lengthy operations such as reading and writing over a blocking connection. Locking lengthy operations can severely impact performance, because all execution threads in the application that use the Windows socket object must wait until Unlock is called.

See Also