From 42a0a10294a7848b5c451aaa02fad1bcefd806b5 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 5 Aug 2016 14:00:59 -0700 Subject: [PATCH] Set the CURRENT_LOOP for processing messages This ensures that timeouts and callbacks are run with the TLS var set --- src/event_loop.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/event_loop.rs b/src/event_loop.rs index cf7e1aa10..ffaf232a9 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -203,7 +203,9 @@ impl Loop { // process the whole queue of messages. if token == 0 { debug!("consuming notification queue"); - self.consume_queue(); + CURRENT_LOOP.set(&self, || { + self.consume_queue(); + }); continue }