comparison util/async.lua @ 7724:20a69ef5570c

util.async: Rename variable to avoid name clash [luacheck]
author Kim Alvefur <zash@zash.se>
date Sat, 19 Nov 2016 01:11:53 +0100
parents 649b89b2c840
children f928695a2af1
comparison
equal deleted inserted replaced
7723:488fddf88ffd 7724:20a69ef5570c
124 self.state = "running"; 124 self.state = "running";
125 while n > 0 and state == "ready" do 125 while n > 0 and state == "ready" do
126 local consumed; 126 local consumed;
127 -- Loop through queue items, and attempt to run them 127 -- Loop through queue items, and attempt to run them
128 for i = 1,n do 128 for i = 1,n do
129 local input = q[i]; 129 local queued_input = q[i];
130 local ok, new_state = coroutine.resume(thread, input); 130 local ok, new_state = coroutine.resume(thread, queued_input);
131 if not ok then 131 if not ok then
132 -- There was an error running the coroutine, save the error, mark runner as ready to begin again 132 -- There was an error running the coroutine, save the error, mark runner as ready to begin again
133 consumed, state, err = i, "ready", debug.traceback(thread, new_state); 133 consumed, state, err = i, "ready", debug.traceback(thread, new_state);
134 self.thread = nil; 134 self.thread = nil;
135 break; 135 break;