Quellcode durchsuchen

Tweak docs on IsEmpty

Evan Huus vor 8 Jahren
Ursprung
Commit
b77c957f7c
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  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
 }