1 Star 0 Fork 43

zhongtao/src-iSulad

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0042-fix-message-queue-concurrent-bug.patch 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
liuxu 提交于 2024-04-20 10:00 . upgrade from upstream
From f90a145d9d29682295aebf2bcd30865ee5f6491f Mon Sep 17 00:00:00 2001
From: jikai <[email protected]>
Date: Tue, 2 Apr 2024 07:53:54 +0000
Subject: [PATCH 42/69] fix message queue concurrent bug
Signed-off-by: jikai <[email protected]>
---
src/daemon/mailbox/message_queue.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/daemon/mailbox/message_queue.c b/src/daemon/mailbox/message_queue.c
index 7fe044f2..7e53301e 100644
--- a/src/daemon/mailbox/message_queue.c
+++ b/src/daemon/mailbox/message_queue.c
@@ -106,11 +106,12 @@ message_queue *message_queue_create(void (*release)(void *))
return NULL;
}
- bq = blocking_queue_create(BLOCKING_QUEUE_NO_TIMEOUT, release);
- if (bq == NULL) {
+ mq->messages = blocking_queue_create(BLOCKING_QUEUE_NO_TIMEOUT, release);
+ if (mq->messages == NULL) {
ERROR("Failed to create events queue");
return NULL;
}
+ bq = mq->messages;
mq->subscribers = map_new(MAP_PTR_INT, MAP_DEFAULT_CMP_FUNC, message_queue_subscriber_free);
if (mq->subscribers == NULL) {
@@ -131,7 +132,7 @@ message_queue *message_queue_create(void (*release)(void *))
return NULL;
}
- mq->messages = isula_transfer_ptr(bq);
+ bq = NULL;
return isula_transfer_ptr(mq);
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/taotao-sauce/src-iSulad.git
[email protected]:taotao-sauce/src-iSulad.git
taotao-sauce
src-iSulad
src-iSulad
master

搜索帮助