Main Content

cancelAcquireResource

Class: matlab.DiscreteEventSystem
Package: matlab

Cancel previously scheduled resource acquisition event

Syntax

event = cancelAcquireResource(tag)

Description

event = cancelAcquireResource(tag) cancels a previously scheduled resource acquisition event.

Input Arguments

expand all

Tag of the previously scheduled resource acquisition event to be canceled.

Output Arguments

expand all

Event for canceling the previously scheduled resource acquisition.

Examples

expand all

Cancel a resource acquisition event when the previously scheduled resource acquisition event times out.

function [entity,events] = timer(obj,storage,entity,tag)  
    % Assume that eventTimer() defines a timer with tag and that there is a previously 
    % scheduled resource acquisition event with 'loadingWorker' tag.
    event = obj.cancelAcquireResource('loadingWorker');  
    % This cancels the 'loadingWorker' acquisition event when the timer finishes.   
end
Introduced in R2019a