webmcp

view framework/env/execute/_initializers.lua @ 343:34bf5f7abe0d

Code cleanup in extos.c: use 1.0e9 instead of 0.000000001 to avoid floating-point inaccuracies, added "const" qualifiers to avoid two compiler warnings
author jbe
date Thu Mar 26 01:56:10 2015 +0100 (2015-03-26)
parents a2c733535b8e
children beb1e7925a52
line source
1 function execute._initializers(initializer_path_element)
2 local yieldvalue1 = {}
3 local yieldvalue2 = {}
4 local coro = coroutine.wrap(function()
5 execute.multi_wrapped(
6 execute._create_sorted_execution_list(
7 function(add_by_path)
8 add_by_path(initializer_path_element)
9 add_by_path(WEBMCP_APP_NAME, initializer_path_element)
10 end,
11 function(full_path, relative_path)
12 execute.file_path{ file_path = full_path }
13 end
14 ),
15 function()
16 coroutine.yield(yieldvalue1)
17 end
18 )
19 return yieldvalue2
20 end)
21 local yieldvalue = coro()
22 if yieldvalue == yieldvalue2 then
23 error("Initializers failed to call execute.inner()")
24 elseif yieldvalue ~= yieldvalue1 then
25 error("Unexpected yield in initializers")
26 end
27 execute._finalizers[#execute._finalizers+1] = function()
28 assert(coro() == yieldvalue2, "Unexpected yield in finalizers")
29 end
30 end

Impressum / About Us