Skip to content

Add OnceCell::wait #102

@matklad

Description

@matklad

This seems plausible:

impl OnceCell<T> {
  /// Blocks until the cell is populated
  fn wait(&self) -> &T {}
}

The implementaiton should basically stuff the current thread into the waiters list, without attempting to set the value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions