Defines a resource that can be occupied by only a limited number of users. The caller has to wait until the number of users who occupy the resource is less than the maximum number of users who are allowed to occupy the resource. To releases a resource, call the GlobalResourceRelease function.
Kernel.bdh
GlobalResourceEnter( in sName : string, in nCount : number optional, in nTimeout : number optional ): number;
Parameter | Description |
---|---|
sName | Name to identify a resource. |
nCount | Number of users who are allowed to enter the resource (optional). If this parameter is omitted, only one user is allowed to enter the resource. |
nTimeout | Maximum waiting time in seconds before a timeout occurs (optional). If this parameter is omitted, the timeout is set to INFINITE. |
var hConnection: number; dcltrans transaction TLogon var nRet: number; begin GlobalResourceEnter("Max 5 logins at a time", 5); OraLogon(hConnection, "user", "password", "orclnet2"); GlobalResourceRelease("Max 5 logins at a time"); GlobalWaitFor("All are logged in"); end TLogon;