From 8edd86da5e26e6053cc596cc0544cc88b7ddaa81 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 22 Nov 2011 09:36:27 +0100 Subject: [PATCH] Bugfix: PROCESS_PAUSE() must explicitly check the event type, otherwise we may cause the process event queue to fill up if we repeatedly call PROCESS_PAUSE() while other (broadcast) events are posted as well, such as timer events. --- core/sys/process.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sys/process.h b/core/sys/process.h index 097ac03cf..4aadf9ca7 100644 --- a/core/sys/process.h +++ b/core/sys/process.h @@ -221,7 +221,7 @@ typedef unsigned char process_num_events_t; */ #define PROCESS_PAUSE() do { \ process_post(PROCESS_CURRENT(), PROCESS_EVENT_CONTINUE, NULL); \ - PROCESS_WAIT_EVENT(); \ + PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_CONTINUE); \ } while(0) /** @} end of protothread functions */