mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
32 lines
381 B
C++
32 lines
381 B
C++
#pragma once
|
|
|
|
#include <util/types.hpp>
|
|
#include "../RSXThread.h"
|
|
|
|
namespace rsx
|
|
{
|
|
class eng_lock
|
|
{
|
|
rsx::thread* pthr;
|
|
|
|
public:
|
|
eng_lock(rsx::thread* target)
|
|
:pthr(target)
|
|
{
|
|
if (pthr->is_current_thread())
|
|
{
|
|
pthr = nullptr;
|
|
}
|
|
else
|
|
{
|
|
pthr->pause();
|
|
}
|
|
}
|
|
|
|
~eng_lock()
|
|
{
|
|
if (pthr) pthr->unpause();
|
|
}
|
|
};
|
|
}
|