Compare commits

...

2 Commits

Author SHA1 Message Date
52f7f6e690 v0.0.26 2022-11-30 23:38:42 +01:00
b1e3891256 v0.0.25 2022-11-30 23:35:47 +01:00
3 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
package dataext
package syncext
import (
"context"
@@ -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

View File

@@ -1,4 +1,4 @@
package dataext
package syncext
import "time"

View File

@@ -1,4 +1,4 @@
package dataext
package syncext
import (
"testing"