onTransfer

open fun onTransfer(source: ITask<*>, destination: ITask<*>)

Called internally when this lock is explicitly transferred to another Task. Transferring locks prevents 'lock stealing' during the small transition period due to .then().

Warning - transferring locks like this can lead to deadlocking if the destination task cannot start due to missing some other dependency.

Parameters

source

Previous owner of the Lock.

destination

Next owner of the Lock, when it begins.