Explorar o código

Tweak docs on IsEmpty

Evan Huus %!s(int64=8) %!d(string=hai) anos
pai
achega
b77c957f7c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      semaphore/semaphore.go

+ 3 - 1
semaphore/semaphore.go

@@ -44,7 +44,9 @@ func (s *Semaphore) Release() {
 	<-s.sem
 }
 
-// IsEmpty would return true if none acquired ar that moment of time, otherwise false.
+// IsEmpty will return true if no tickets are being held at that instant.
+// It is safe to call concurrently with Acquire and Release, though do note
+// that the result may then be unpredictable.
 func (s *Semaphore) IsEmpty() bool {
 	return len(s.sem) == 0
 }