From 4f7255c731cdcba363f4365b3f4ef387e796a08f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 26 Apr 2024 13:24:04 +0800 Subject: [PATCH] 1 --- queue.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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() +}