blob: 20df97906d87e989b32edba2dd7a02c164d37d59 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001#ifndef AOS_REALTIME_H_
2#define AOS_REALTIME_H_
3
James Kuszmaul57c2baa2020-01-19 14:52:52 -08004#include <string_view>
Alex Perrycb7da4b2019-08-28 19:35:56 -07005
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.
James Kuszmaul57c2baa2020-01-19 14:52:52 -080019void SetCurrentThreadName(const std::string_view name);
Alex Perrycb7da4b2019-08-28 19:35:56 -070020
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
James Kuszmaulb4874eb2020-01-18 17:50:35 -080031void ExpandStackSize();
32
Alex Perrycb7da4b2019-08-28 19:35:56 -070033} // namespace aos
34
35#endif // AOS_REALTIME_H_