ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
Jam.Threading.TJamInterlocked.IntfAssignIfEmpty
Syntax
Pascal
class function IntfAssignIfEmpty<T:IInterface>(var pIntf; const pValue: T): Boolean; overload; static;
Parameters 
Description 
var pIntf 
The interface variable or member that should be assigned. 
const pValue: T 
The new interface value that should get assigned. 

True if an target variable was nil, False if a value was already assigned to it.

Assigns an interface to a variable, but only if this was empty, in an atomic and so threadsafe operation.

The given interfaces is released in case it was not assigned to the variable because it was not empty.