Skip to content

proposal: sync: add blocking methods with Context parameter to Once and WaitGroup #25312

@daviddengcn

Description

@daviddengcn

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.10.2

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

all

What did you do?

n/a

What did you expect to see?

sync.Once once;
once.DoWithContext(ctx, f) // when ctx is cancelled, f is still running but the caller can return immediately

Similar to WaitGroup.WaitWithContext.

What did you see instead?

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions