1
0

Debuggers: Added a deadlock simulation command.

This commit is contained in:
Mattes D 2017-01-18 09:02:56 +01:00
parent a52de8e8cd
commit 49e05d8cfe
2 changed files with 34 additions and 0 deletions

View File

@ -2420,6 +2420,34 @@ end
function HandleConsoleDeadlock(a_Split)
-- If given a parameter, assume it's a world name and simulate a deadlock in the world's tick thread
if (a_Split[2]) then
local world = cRoot:Get():GetWorld(a_Split[2])
if (world) then
world:ScheduleTask(0,
function()
-- Make a live-lock:
while (true) do
end
end
)
return true, "Deadlock in world tick thread for world " .. a_Split[2] .. " has been scheduled."
end
LOG("Not a world name: " .. a_Split[2] .. "; simulating a deadlock in the command execution thread instead.")
else
LOG("Simulating a deadlock in the command execution thread.")
end
-- Make a live-lock in the command execution thread:
while(true) do
end
end
function HandleConsoleDownload(a_Split) function HandleConsoleDownload(a_Split)
-- Check params: -- Check params:
local url = a_Split[2] local url = a_Split[2]

View File

@ -266,6 +266,12 @@ g_PluginInfo =
HelpString = "Performs cBoundingBox API tests", HelpString = "Performs cBoundingBox API tests",
}, },
["deadlock"] =
{
Handler = HandleConsoleDeadlock,
HelpString = "Simulates a deadlock, either on the command execution thread, or on a world tick thread",
},
["download"] = ["download"] =
{ {
Handler = HandleConsoleDownload, Handler = HandleConsoleDownload,