Skip to content

Commit

Permalink
protect close with a mutex in serial channel
Browse files Browse the repository at this point in the history
Summary:
protect close with a mutex in serial channel

All other public methods are protected with a mutex, so we probably should also protect the close method.

Reviewed By: echistyakov, Reincarnationist

Differential Revision: D59956820

fbshipit-source-id: d50bba185a78ee4e16a46ad934dc064c04f672f5
  • Loading branch information
Walter Schulze authored and facebook-github-bot committed Jul 22, 2024
1 parent 265b61a commit 50e35a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions third-party/thrift/src/thrift/lib/go/thrift/serial_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func (c *SerialChannel) recvMsg(method string, seqID int32, response IResponse)

// Close closes the client connection
func (c *SerialChannel) Close() error {
c.lock.Lock()
defer c.lock.Unlock()
return c.protocol.Close()
}

Expand Down

0 comments on commit 50e35a9

Please sign in to comment.