pacemaker 3.0.3
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
AvSetMmThreadOptions.hpp
Go to the documentation of this file.
1#ifndef PACEMAKER_TIMER_AVSETMMTHREADOPTIONS_HPP_
2#define PACEMAKER_TIMER_AVSETMMTHREADOPTIONS_HPP_
3
4#include <avrt.h>
5
6namespace pacemaker::timer
7{
28 {
37 auto av_set() -> void
38 {
39 DWORD taskIndex{0};
40 this->hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex);
41 AvSetMmThreadPriority(this->hTask, AVRT_PRIORITY_HIGH);
42 }
43
50 auto av_revert() -> void { AvRevertMmThreadCharacteristics(this->hTask); }
51
52 private:
54 HANDLE hTask;
55 };
56} // namespace pacemaker::timer
57
58#endif // PACEMAKER_TIMER_AVSETMMTHREADOPTIONS_HPP_
Helper class for Windows Multimedia Scheduler Service (MMCSS) thread elevation.
auto av_set() -> void
Elevates the calling thread to the MMCSS "Pro Audio" task.
auto av_revert() -> void
Reverts the calling thread's MMCSS scheduling characteristics.