thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens-G <...@git.apache.org>
Subject [GitHub] thrift pull request #1304: THRIFT-4237 Fix effective deadlock introduced by ...
Date Fri, 07 Jul 2017 18:58:50 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message