Implement a watchdog timer for scripts that take too long to execute (bug 5837, r=fyren).

--HG--
extra : rebase_source : ffacb38457eca581660ce8f15c444ad828b7fedd
This commit is contained in:
David Anderson
2013-08-14 23:54:25 -07:00
parent 74f1b800c2
commit 3ac43497b9
25 changed files with 1250 additions and 99 deletions
+11 -1
View File
@@ -1,5 +1,5 @@
/**
* vim: set ts=4 sw=4 :
* vim: set ts=4 sw=4 tw=99 noet:
* =============================================================================
* SourceMod
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
@@ -311,6 +311,16 @@ void SourceModBase::StartSourceMod(bool late)
{
extsys->LoadAutoExtension("updater.ext." PLATFORM_LIB_EXT);
}
const char *timeout = GetCoreConfigValue("SlowScriptTimeout");
if (timeout == NULL)
{
timeout = "8";
}
if (atoi(timeout) != 0)
{
g_pSourcePawn2->InstallWatchdogTimer(atoi(timeout) * 1000);
}
}
static bool g_LevelEndBarrier = false;