mirror of https://github.com/pulumi/pulumi.git
e4529562cf
The currentProject is stored as a plain field on the local backend. This is fine right now because SetCurrentProject is not expected to be called concurrently with anything else. However, in #12437 (project-scoped stacks), we need to be able to access the current project in a context where there are no guarantees about SetCurrentProject being called concurrently with other operations. This switches the currentProject into an atomic.Pointer that we can Load and Swap in a thread-safe manner. Note that this does not protect us from data races caused by concurrent mutations to the workspace.Project struct's fields, but that doesn't appear to be a concern; the code treats that object as a blob of constant values. Extracted from #12437 |
||
---|---|---|
.. | ||
display | ||
filestate | ||
httpstate | ||
state | ||
apply.go | ||
backend.go | ||
backend_test.go | ||
doc.go | ||
errors.go | ||
mock.go | ||
policypack.go | ||
query.go | ||
snapshot.go | ||
snapshot_test.go | ||
stack.go | ||
updates.go | ||
watch.go |