You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by jeking3 <gi...@git.apache.org> on 2016/07/15 13:31:27 UTC

[GitHub] thrift pull request #1028: MOD: fix the blocked bug when call Stop() twice o...

Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1028#discussion_r70972828
  
    --- Diff: lib/go/thrift/simple_server.go ---
    @@ -149,8 +151,10 @@ func (p *TSimpleServer) Serve() error {
     }
     
     func (p *TSimpleServer) Stop() error {
    -	p.quit <- struct{}{}
    -	p.serverTransport.Interrupt()
    +	if atomic.CompareAndSwapInt64(&p.stopped, 0, 1) {
    --- End diff --
    
    Hi, still looking for a reply to my last comment about 0 and 1.  I think your code relies on the fact that stop is called twice, as it will skip the first bump of the counter from 0 to 1, and then on the second call to stop it will actually stop, so I cannot approve the request.  If I misread it please let me know.


---
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.
---