mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 21:11:25 +12:00
Implement thread_ctrl::scoped_priority
RAII priority control (+1, or -1)
This commit is contained in:
parent
a69248299d
commit
ee288340b0
7 changed files with 26 additions and 11 deletions
|
@ -281,6 +281,24 @@ public:
|
|||
// Get current thread stack addr and size
|
||||
static std::pair<void*, usz> get_thread_stack();
|
||||
|
||||
// Sets the native thread priority and returns it to zero at destructor
|
||||
struct scoped_priority
|
||||
{
|
||||
explicit scoped_priority(int prio)
|
||||
{
|
||||
set_native_priority(prio);
|
||||
}
|
||||
|
||||
scoped_priority(const scoped_priority&) = delete;
|
||||
|
||||
scoped_priority& operator=(const scoped_priority&) = delete;
|
||||
|
||||
~scoped_priority()
|
||||
{
|
||||
set_native_priority(0);
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
// Miscellaneous
|
||||
static const u64 process_affinity_mask;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue