From f3b1f5be510259880c35691ba873564e1ccb6bc2 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 26 May 2014 13:18:09 +0800 Subject: [PATCH] bugfix: check globalmq push is complete --- skynet-src/skynet_mq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skynet-src/skynet_mq.c b/skynet-src/skynet_mq.c index d146fd56..f4814450 100644 --- a/skynet-src/skynet_mq.c +++ b/skynet-src/skynet_mq.c @@ -88,6 +88,10 @@ skynet_globalmq_pop() { } struct message_queue * mq = q->queue[head_ptr]; + if (mq == NULL) { + // globalmq push not complete + return NULL; + } if (!__sync_bool_compare_and_swap(&q->head, head, head+1)) { return NULL; }