Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1645)

Unified Diff: utils.h

Issue 3053049: Nice automatic updates up to a point, then renice if necessary. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: better documentation Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_attempter.cc ('k') | utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.h
diff --git a/utils.h b/utils.h
index 6ce4cf36ad20ed219ddc8d681af902af63b58024..8438313808caedffa0181e0eea9899cf3fe4bb22 100644
--- a/utils.h
+++ b/utils.h
@@ -6,11 +6,14 @@
#define CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__
#include <errno.h>
+
#include <algorithm>
#include <set>
#include <string>
#include <vector>
+
#include <glib.h>
+
#include "update_engine/action.h"
#include "update_engine/action_processor.h"
@@ -183,6 +186,21 @@ const std::string BootDevice();
// Returns empty string on failure.
const std::string BootKernelDevice(const std::string& boot_device);
+enum ProcessPriority {
+ kProcessPriorityHigh = -10,
+ kProcessPriorityNormal = 0,
+ kProcessPriorityLow = 10,
+};
+
+// Compares process priorities and returns an integer that is less
+// than, equal to or greater than 0 if |priority_lhs| is,
+// respectively, lower than, same as or higher than |priority_rhs|.
+int ComparePriorities(ProcessPriority priority_lhs,
+ ProcessPriority priority_rhs);
+
+// Sets the current process priority to |priority|. Returns true on
+// success, false otherwise.
+bool SetProcessPriority(ProcessPriority priority);
} // namespace utils
« no previous file with comments | « update_attempter.cc ('k') | utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698