diff options
Diffstat (limited to 'stmutil/context.go')
-rw-r--r-- | stmutil/context.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmutil/context.go b/stmutil/context.go index 8a4d58d..6f8ba9b 100644 --- a/stmutil/context.go +++ b/stmutil/context.go @@ -9,12 +9,12 @@ import ( var ( mu sync.Mutex - ctxVars = map[context.Context]*stm.Var{} + ctxVars = map[context.Context]*stm.Var[bool]{} ) // Returns an STM var that contains a bool equal to `ctx.Err != nil`, and a cancel function to be // called when the user is no longer interested in the var. -func ContextDoneVar(ctx context.Context) (*stm.Var, func()) { +func ContextDoneVar(ctx context.Context) (*stm.Var[bool], func()) { mu.Lock() defer mu.Unlock() if v, ok := ctxVars[ctx]; ok { |