浏览代码

Tweak docs on IsEmpty

Evan Huus 8 年之前
父节点
当前提交
b77c957f7c
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      semaphore/semaphore.go

+ 3 - 1
semaphore/semaphore.go

@@ -44,7 +44,9 @@ func (s *Semaphore) Release() {
 	<-s.sem
 	<-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 {
 func (s *Semaphore) IsEmpty() bool {
 	return len(s.sem) == 0
 	return len(s.sem) == 0
 }
 }