There is not a specific method or call to release a reserved resource. You need to explicitly destroy the route following the next steps:
- Stop the task that initially reserved the resource.
- Remove the route by returning the corresponding trigger or clock property to its default value.
- Commit the tasks and/or restart it if needed.
- Reserve the resource by the second task.
- Commit and/or restart the second task when needed.
Note: there is not an explicit method to release a reserved resource. You need to explicitly destroy the route to make the resource available for a different task.
Note: this cannot be done on the fly because changing the route requires the task to be committed, so you'll need to stop all involved tasks, implement the change, and restart the tasks.
Note: refer to Task State Model in the Related Links section for more information about the committed state, and other task states.