v0.0.26
This commit is contained in:
parent
b1e3891256
commit
52f7f6e690
@ -56,6 +56,12 @@ func (a *AtomicBool) Wait(waitFor bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *AtomicBool) WaitWithTimeout(timeout time.Duration, waitFor bool) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
return a.WaitWithContext(ctx, waitFor)
|
||||
}
|
||||
|
||||
func (a *AtomicBool) WaitWithContext(ctx context.Context, waitFor bool) error {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user