fix synchronization issues, use AtomicFlag/atomic.Value for shared fields

This commit is contained in:
David Zhao
2021-01-29 00:49:32 -08:00
parent dd8a1a5055
commit 57a13f9930
6 changed files with 53 additions and 49 deletions
+2 -3
View File
@@ -38,9 +38,8 @@ func TestIsReady(t *testing.T) {
for _, test := range tests {
t.Run(test.state.String(), func(t *testing.T) {
p := &ParticipantImpl{
state: test.state,
}
p := &ParticipantImpl{}
p.state.Store(test.state)
assert.Equal(t, test.ready, p.IsReady())
})
}