replace

expect fun replace(disposable: Disposable?): Disposable?

Atomically either replaces any existing Disposable with the specified one or disposes it if wrapper is already disposed. Does not dispose any replaced Disposable.

Return

replaced Disposable if any

Parameters

disposable

a new Disposable, will be disposed if wrapper is already dispose

actual fun replace(disposable: Disposable?): Disposable?

Atomically either replaces any existing Disposable with the specified one or disposes it if wrapper is already disposed. Does not dispose any replaced Disposable.

Return

replaced Disposable if any

Parameters

disposable

a new Disposable, will be disposed if wrapper is already dispose

actual fun replace(disposable: Disposable?): Disposable?

Atomically either replaces any existing Disposable with the specified one or disposes it if wrapper is already disposed. Does not dispose any replaced Disposable.

Return

replaced Disposable if any

Parameters

disposable

a new Disposable, will be disposed if wrapper is already dispose