File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1033,7 +1033,7 @@ func (conn *Connection) newFuture(ctx context.Context) (fut *Future) {
1033
1033
shardn := fut .requestId & (conn .opts .Concurrency - 1 )
1034
1034
shard := & conn .shard [shardn ]
1035
1035
shard .rmut .Lock ()
1036
- switch conn .state {
1036
+ switch atomic . LoadUint32 ( & conn .state ) {
1037
1037
case connClosed :
1038
1038
fut .err = ClientError {
1039
1039
ErrConnectionClosed ,
@@ -1730,9 +1730,10 @@ func (conn *Connection) shutdown() {
1730
1730
conn .mutex .Lock ()
1731
1731
defer conn .mutex .Unlock ()
1732
1732
1733
- if ! atomic .CompareAndSwapUint32 (& ( conn .state ) , connConnected , connShutdown ) {
1733
+ if ! atomic .CompareAndSwapUint32 (& conn .state , connConnected , connShutdown ) {
1734
1734
return
1735
1735
}
1736
+
1736
1737
conn .cond .Broadcast ()
1737
1738
conn .notify (Shutdown )
1738
1739
You can’t perform that action at this time.
0 commit comments