Sage Modeling and Simulation Library

ResourceRequest..::..Acquire Method

Acquires a resource from the specified resource manager, or the provided default manager, if none is provided in this call. If the request has already successfully reserved a resource, then the reservation is revoked and the acquisition is honored in one atomic operation.

Namespace:  Highpoint.Sage.Resources
Assembly:  Sage4 (in Sage4.dll)

Syntax


public bool Acquire(
	IResourceManager resourceManager,
	bool blockAwaitingAcquisition
)

Parameters

resourceManager
Type: Highpoint.Sage.Resources..::..IResourceManager
The resource manager from which the resource is desired. Can be null, if a default manager has been provided.
blockAwaitingAcquisition
Type: Boolean
If true, this call blocks until the resource is available.

Return Value

true if the acquisition was successful, false otherwise.

Exceptions


ExceptionCondition
ApplicationExceptionAcquire API on resource request was called with neither an explicit nor a default resource manager.