You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/13 13:06:24 UTC

[GitHub] [pulsar-client-go] gunli opened a new issue, #845: semaphore release: is this a bug?

gunli opened a new issue, #845:
URL: https://github.com/apache/pulsar-client-go/issues/845

   #### Expected behavior
   ``` go
   func (s *semaphore) Release() {
   	permits := atomic.AddInt32(&s.permits, -1)
   	if permits >= s.maxPermits {
   		// Unblock the next in line to acquire the semaphore
   		s.ch <- true
   	}
   }
   ```
   I think we should unblock when permits < s.maxPermits
   
   #### Actual behavior
   
   but we unblock here when permits >= s.maxPermits, which indicating no available permits. It really confused me.
   
   #### Steps to reproduce
   
   
   
   #### System configuration
   
   @merlimat 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] gunli closed issue #845: semaphore release: is this a bug?

Posted by GitBox <gi...@apache.org>.
gunli closed issue #845: semaphore release: is this a bug?
URL: https://github.com/apache/pulsar-client-go/issues/845


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org