mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-04-20 22:05:06 +00:00
SMutex partially replaced with std::mutex
SPURecompiler.h: SETcc bug fixed
This commit is contained in:
parent
237e7989b4
commit
90b9861043
21 changed files with 114 additions and 106 deletions
|
|
@ -13,6 +13,9 @@ class NamedThreadBase
|
|||
{
|
||||
std::string m_name;
|
||||
|
||||
std::condition_variable m_signal_cv;
|
||||
std::mutex m_signal_mtx;
|
||||
|
||||
public:
|
||||
NamedThreadBase(const std::string& name) : m_name(name)
|
||||
{
|
||||
|
|
@ -24,6 +27,17 @@ public:
|
|||
|
||||
virtual std::string GetThreadName() const;
|
||||
virtual void SetThreadName(const std::string& name);
|
||||
|
||||
void WaitForAnySignal() // wait 1 ms for something
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_signal_mtx);
|
||||
m_signal_cv.wait_for(lock, std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
void Notify() // wake up waiting thread or nothing
|
||||
{
|
||||
m_signal_cv.notify_one();
|
||||
}
|
||||
};
|
||||
|
||||
NamedThreadBase* GetCurrentNamedThread();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue