From f380ca586387b2216806225bedb0c29e2e37cb92 Mon Sep 17 00:00:00 2001
From: "Dmitry E. Oboukhov" <unera@debian.org>
Date: Fri, 14 Dec 2012 14:29:12 +0400
Subject: [PATCH] has_readers & has_writers methods without race condition

---
 src/ipc.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ipc.m b/src/ipc.m
index 889f57926e..9ece779959 100644
--- a/src/ipc.m
+++ b/src/ipc.m
@@ -194,13 +194,13 @@ ipc_channel_put(struct ipc_channel *ch, void *data)
 bool
 ipc_channel_has_readers(struct ipc_channel *ch)
 {
-	return !rlist_empty(&ch->readers);
+	return ch->creaders > 0;
 }
 
 bool
 ipc_channel_has_writers(struct ipc_channel *ch)
 {
-	return !rlist_empty(&ch->writers);
+	return ch->cwriters > 0;
 }
 
 int
-- 
GitLab