function MonitorEnter(const AObject: TObject; Timeout: Cardinal = INFINITE): Boolean;
extern DELPHI_PACKAGE bool __fastcall MonitorEnter(TObject* const AObject, unsigned Timeout = (unsigned)(0xffffffff));
Prohibits the access of all other threads but the calling one to the specified object.
Use the MonitorEnter function to prohibit AObject from being accessed by threads, other than the calling one.
Before attempting to lock the specified object, MonitorEnter tests whether the thread that is currently locking the object, if any, has made an equal number of calls to MonitorEnter and to MonitorExit. If not, the calling thread is blocked from accessing the object until the previous thread releases it.
MonitorEnter attempts to lock the specified object for the amount of time designated by the Timeout parameter. If the lock attempt is successful, MonitorEnter returns True, otherwise it returns False.