RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSoapDataModule.Lock Method

Locks the SOAP data module so that it can't be locked by other threads.

Pascal
procedure Lock; virtual;
C++
virtual __fastcall Lock();

SOAP data modules use Lock internally to ensure that all IAppServer calls are thread-safe. When implementing a SOAP data module descendant, call Lock before accessing any instance data, including the providers contained in the data module. When finished with the block of code that must be protected from thread conflicts, call the Unlock method to release the lock. 

Lock uses a critical section to guard against thread conflicts. This means that any code that accesses the SOAP data module's properties or contained objects must call Lock or it will introduce thread conflicts. 

 

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