util.async: Log warning when unexpected state is reached
authorMatthew Wild <mwild1@gmail.com>
Fri, 16 Mar 2018 17:11:23 +0000
changeset 8604 ce5b16e13573
parent 8603 96f20cf92b84
child 8605 9901deadc068
util.async: Log warning when unexpected state is reached
util/async.lua
--- a/util/async.lua	Fri Mar 16 14:59:41 2018 +0000
+++ b/util/async.lua	Fri Mar 16 17:11:23 2018 +0000
@@ -12,6 +12,7 @@
 local function runner_continue(thread)
 	-- ASSUMPTION: runner is in 'waiting' state (but we don't have the runner to know for sure)
 	if coroutine.status(thread) ~= "suspended" then -- This should suffice
+		log("warn", "unexpected async state: thread not suspended");
 		return false;
 	end
 	local ok, state, runner = coroutine.resume(thread);