Parcourir la source

Tweak docs on IsEmpty

Evan Huus il y a 8 ans
Parent
commit
b77c957f7c
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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
 }