summaryrefslogtreecommitdiffstats
path: root/Server
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-01-18 10:51:17 +0100
committerGitHub <noreply@github.com>2017-01-18 10:51:17 +0100
commit0256daa7ca98bab7482581dad39f66d570030874 (patch)
treede9232cbf239800ea1e7a71cf52086509a9472ea /Server
parentUpdated Github label links (#3543) (diff)
parentDeadlockDetect now lists some tracked CS's stats. (diff)
downloadcuberite-0256daa7ca98bab7482581dad39f66d570030874.tar
cuberite-0256daa7ca98bab7482581dad39f66d570030874.tar.gz
cuberite-0256daa7ca98bab7482581dad39f66d570030874.tar.bz2
cuberite-0256daa7ca98bab7482581dad39f66d570030874.tar.lz
cuberite-0256daa7ca98bab7482581dad39f66d570030874.tar.xz
cuberite-0256daa7ca98bab7482581dad39f66d570030874.tar.zst
cuberite-0256daa7ca98bab7482581dad39f66d570030874.zip
Diffstat (limited to 'Server')
-rw-r--r--Server/Plugins/Debuggers/Debuggers.lua28
-rw-r--r--Server/Plugins/Debuggers/Info.lua6
2 files changed, 34 insertions, 0 deletions
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua
index 28b7e254d..c433148ca 100644
--- a/Server/Plugins/Debuggers/Debuggers.lua
+++ b/Server/Plugins/Debuggers/Debuggers.lua
@@ -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)
-- Check params:
local url = a_Split[2]
diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua
index a29ab5995..028f7a70b 100644
--- a/Server/Plugins/Debuggers/Info.lua
+++ b/Server/Plugins/Debuggers/Info.lua
@@ -266,6 +266,12 @@ g_PluginInfo =
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"] =
{
Handler = HandleConsoleDownload,