mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
使用spinlock,避免cas不能充分调度testdeadloop这样的用例
This commit is contained in:
10
test/testdeadloop.lua
Normal file
10
test/testdeadloop.lua
Normal 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)
|
||||
Reference in New Issue
Block a user