UnderrunHandler.h (970B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef MOZILLA_UNDERRUNHANDLER_H_ 7 #define MOZILLA_UNDERRUNHANDLER_H_ 8 9 namespace mozilla { 10 // Install an handler on SIGXPCU for the calling thread, that calls 11 // `UnderrunHandler` when the soft real-time limit has been reached. If a 12 // handler was already in place, this does nothing. No-op if not on Linux 13 // Desktop. 14 void InstallSoftRealTimeLimitHandler(); 15 // Query whether or not the soft-real-time limit has been reached. Always 16 // false when not on Linux desktop. Can be called from any thread. 17 bool SoftRealTimeLimitReached(); 18 // Set the calling thread to a normal scheduling class. 19 void DemoteThreadFromRealTime(); 20 } // namespace mozilla 21 22 #endif // MOZILLA_UNDERRUNHANDLER_H_