Application::DeclareRLimitStack(Application::GetDefaultRLimitStack());
#endif /* __linux__ */
Application::DeclareConcurrency(std::thread::hardware_concurrency());
+ Application::DeclareMaxConcurrentChecks(Application::GetDefaultMaxConcurrentChecks());
ScriptGlobal::Set("AttachDebugger", false);
return ScriptGlobal::Get("Concurrency", &defaultConcurrency);
}
+/**
+ * Sets the max concurrent checks.
+ *
+ * @param maxChecks The new limit.
+ */
+void Application::SetMaxConcurrentChecks(int maxChecks)
+{
+ ScriptGlobal::Set("MaxConcurrentChecks", maxChecks);
+}
+
+/**
+ * Sets the max concurrent checks.
+ *
+ * @param maxChecks The new limit.
+ */
+void Application::DeclareMaxConcurrentChecks(int maxChecks)
+{
+ if (!ScriptGlobal::Exists("MaxConcurrentChecks"))
+ ScriptGlobal::Set("MaxConcurrentChecks", maxChecks);
+}
+
+/**
+ * Retrieves the max concurrent checks.
+ *
+ * @returns The max number of concurrent checks.
+ */
+int Application::GetMaxConcurrentChecks()
+{
+ Value defaultMaxConcurrentChecks = GetDefaultMaxConcurrentChecks();
+ return ScriptGlobal::Get("MaxConcurrentChecks", &defaultMaxConcurrentChecks);
+}
+
+/**
+ * Retrieves the default value for max concurrent checks.
+ *
+ * @returns The default max number of concurrent checks.
+ */
+int Application::GetDefaultMaxConcurrentChecks()
+{
+ return 512;
+}
+
/**
* Returns the global thread pool.
*
static int GetConcurrency();
static void DeclareConcurrency(int ncpus);
+ static int GetMaxConcurrentChecks();
+ static int GetDefaultMaxConcurrentChecks();
+ static void DeclareMaxConcurrentChecks(int maxChecks);
+ static void SetMaxConcurrentChecks(int maxChecks);
+
static ThreadPool& GetTP();
static String GetAppVersion();
class CheckerComponent : ConfigObject
{
[config] int concurrent_checks {
+ get {{{
+ return Application::GetMaxConcurrentChecks();
+ }}}
+ set {{{
+ Application::SetMaxConcurrentChecks(value);
+ }}}
default {{{
- return 512;
+ return Application::GetDefaultMaxConcurrentChecks();
}}}
};
};