使用spinlock,避免cas不能充分调度testdeadloop这样的用例

This commit is contained in:
xjdrew
2014-12-04 15:50:19 +08:00
parent 6f6039c136
commit a0d2c7172c
2 changed files with 30 additions and 49 deletions

10
test/testdeadloop.lua Normal file
View File

@@ -0,0 +1,10 @@
local skynet = require "skynet"
local function dead_loop()
while true do
skynet.sleep(0)
end
end
skynet.start(function()
skynet.fork(dead_loop)
end)