diff --git a/queue.go b/queue.go index 80b9e63..841a558 100644 --- a/queue.go +++ b/queue.go @@ -30,3 +30,12 @@ func (this *Queue) Fetch() { } } } + +func (this *Queue) IsEmpty() bool { + if !this.WorkList.Empty() { + return false + } + this.msgMutex.Lock() + defer this.msgMutex.Unlock() + return this.msgList.Empty() +}