Skip to content

Commit

Permalink
Make OutputState pass the -race detector
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Nov 3, 2022
1 parent 905756b commit 46ced86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/go/pulumi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,14 @@ func (o *OutputState) elementType() reflect.Type {
return o.element
}

// Fetch the dependencies of an OutputState. It is not thread-safe to mutate values inside
// returned slice.
func (o *OutputState) dependencies() []Resource {
if o == nil {
return nil
}
o.cond.L.Lock()
defer o.cond.L.Unlock()
return o.deps
}

Expand Down

0 comments on commit 46ced86

Please sign in to comment.