main thread will enter a while loop after spawn thread A, the end condition of this loop is “lrucache:get(key) == nil”,
after http:connect() and do something, thread A will execute lrucache:set(key, nil)
trouble:
when thread A get yield cause by http:connect(), the main thread get into infinite loop. Thread A seems never get scheduled after yielded.
solution i tried:
1.call coroutine.resume(thread A) in main thread. It dosen't worked, main thread still run in infinite loop
2.write a condition in main thread like this:
if lrucache:get(“key”) == nil then
coroutine.yield(coroutine.running())
end
It still doesn’t worked…
I hope someone can help me or tell me why is like that…. T_T