blob: a6b422314c08009a1d6e8e13d909fab530e4dd01 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001#ifndef AOS_REALTIME_H_
2#define AOS_REALTIME_H_
3
4#include <string>
5
6namespace aos {
7
8// Locks everything into memory and sets the limits. This plus InitNRT are
9// everything you need to do before SetCurrentThreadRealtimePriority will make
10// your thread RT. Called as part of ShmEventLoop::Run()
11void InitRT();
12
13// Sets the current thread back down to non-realtime priority.
14void UnsetCurrentThreadRealtimePriority();
15
16// Sets the name of the current thread.
17// This will displayed by `top -H`, dump_rtprio, and show up in logs.
18// name can have a maximum of 16 characters.
19void SetCurrentThreadName(const ::std::string &name);
20
21// Sets the current thread's realtime priority.
22void SetCurrentThreadRealtimePriority(int priority);
23
24// Sets up this process to write core dump files.
25// This is called by Init*, but it's here for other files that want this
26// behavior without calling Init*.
27void WriteCoreDumps();
28
29void LockAllMemory();
30
31} // namespace aos
32
33#endif // AOS_REALTIME_H_