File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -770,29 +770,29 @@ func (c *Client) reader(t transport, disconnectCh chan struct{}) {
770770
771771func (c * Client ) runHandlerSync (fn func ()) {
772772 c .mu .RLock ()
773- if c .cbQueue == nil {
774- c .mu .RUnlock ()
773+ queue := c .cbQueue
774+ c .mu .RUnlock ()
775+ if queue == nil {
775776 return
776777 }
777778 waitCh := make (chan struct {})
778- c . cbQueue .push (func (delay time.Duration ) {
779+ queue .push (func (delay time.Duration ) {
779780 defer close (waitCh )
780781 fn ()
781782 })
782- c .mu .RUnlock ()
783783 <- waitCh
784784}
785785
786786func (c * Client ) runHandlerAsync (fn func ()) {
787787 c .mu .RLock ()
788- if c .cbQueue == nil {
789- c .mu .RUnlock ()
788+ queue := c .cbQueue
789+ c .mu .RUnlock ()
790+ if queue == nil {
790791 return
791792 }
792- c . cbQueue .push (func (delay time.Duration ) {
793+ queue .push (func (delay time.Duration ) {
793794 fn ()
794795 })
795- c .mu .RUnlock ()
796796}
797797
798798func (c * Client ) handle (reply * protocol.Reply ) {
You can’t perform that action at this time.
0 commit comments