#include "tensorstore/util/future.h"
void tensorstore::FutureCallbackRegistration::Unregister() noexcept;

Unregisters the associated callback.

  1. If the associated callback has already finished running, or has already been unregistered, this has no effect.

  2. If the associated callback is currently running in another thread, this blocks until the callback finishes running. This has the potential to cause deadlock if not used carefully. Use UnregisterNonBlocking instead to reduce the risk of deadlock if this blocking behavior is not required.

  3. If the associated callback is currently running in the current thread, i.e. the callback has directly or indirectly attempted to unregister itself, then this function returns immediately (it does not deadlock).

In all cases, after this function returns, the handle is null.

Note

In cases 1 and 2, it is guaranteed that no code within the callback will execute once Unregister returns. The only exception is case 3, where this guarantee is impossible.

threadsafety This method is NOT safe to call concurrently from multiple

threads on the same handle, but is safe to call concurrently from multiple threads on different handles that refer to the same callback.