Github user Jens-G commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1304#discussion_r126221534
  
    --- Diff: lib/go/thrift/server_socket.go ---
    @@ -68,15 +68,18 @@ func (p *TServerSocket) Listen() error {
     
     func (p *TServerSocket) Accept() (TTransport, error) {
        p.mu.RLock()
    -   defer p.mu.RUnlock()
    +   listener := p.listener
    +   interrupted := p.interrupted
    +   p.mu.RUnlock()
     
    --- End diff --
    
    Agree. Looks strange. and the comment even says
    
          // Protects the interrupted value to make it thread safe.
    
    What about moving the ```listener := p.listener``` line down just before it 
is used? Or do I overlook sth?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to