mirror of https://github.com/PCSX2/pcsx2.git
gsdx: always enable CXX11 mutex feature.
ifdef was only useful for VS2010
This commit is contained in:
parent
ca9b5ce11d
commit
3706cfe908
|
@ -904,11 +904,7 @@ EXPORT_C GSgetTitleInfo2(char* dest, size_t length)
|
||||||
// TODO: this gets called from a different thread concurrently with GSOpen (on linux)
|
// TODO: this gets called from a different thread concurrently with GSOpen (on linux)
|
||||||
if (gsopen_done && s_gs != NULL && s_gs->m_GStitleInfoBuffer[0])
|
if (gsopen_done && s_gs != NULL && s_gs->m_GStitleInfoBuffer[0])
|
||||||
{
|
{
|
||||||
#ifdef _CX11_
|
|
||||||
std::lock_guard<std::mutex> lock(s_gs->m_pGSsetTitle_Crit);
|
std::lock_guard<std::mutex> lock(s_gs->m_pGSsetTitle_Crit);
|
||||||
#else
|
|
||||||
GSAutoLock lock(&s_gs->m_pGSsetTitle_Crit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
s.append(" | ").append(s_gs->m_GStitleInfoBuffer);
|
s.append(" | ").append(s_gs->m_GStitleInfoBuffer);
|
||||||
|
|
||||||
|
|
|
@ -393,11 +393,7 @@ GSCapture::~GSCapture()
|
||||||
|
|
||||||
bool GSCapture::BeginCapture(float fps)
|
bool GSCapture::BeginCapture(float fps)
|
||||||
{
|
{
|
||||||
#ifdef _CX11_
|
|
||||||
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
||||||
#else
|
|
||||||
GSAutoLock lock(&m_lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ASSERT(fps != 0);
|
ASSERT(fps != 0);
|
||||||
|
|
||||||
|
@ -508,11 +504,7 @@ bool GSCapture::BeginCapture(float fps)
|
||||||
|
|
||||||
bool GSCapture::DeliverFrame(const void* bits, int pitch, bool rgba)
|
bool GSCapture::DeliverFrame(const void* bits, int pitch, bool rgba)
|
||||||
{
|
{
|
||||||
#ifdef _CX11_
|
|
||||||
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
||||||
#else
|
|
||||||
GSAutoLock lock(&m_lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(bits == NULL || pitch == 0)
|
if(bits == NULL || pitch == 0)
|
||||||
{
|
{
|
||||||
|
@ -545,11 +537,7 @@ bool GSCapture::DeliverFrame(const void* bits, int pitch, bool rgba)
|
||||||
|
|
||||||
bool GSCapture::EndCapture()
|
bool GSCapture::EndCapture()
|
||||||
{
|
{
|
||||||
#ifdef _CX11_
|
|
||||||
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
std::lock_guard<std::recursive_mutex> lock(m_lock);
|
||||||
#else
|
|
||||||
GSAutoLock lock(&m_lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "GSVector.h"
|
#include "GSVector.h"
|
||||||
#ifndef _CX11_
|
|
||||||
#include "GSThread.h"
|
|
||||||
#endif
|
|
||||||
#include "GSPng.h"
|
#include "GSPng.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
@ -33,11 +30,7 @@
|
||||||
|
|
||||||
class GSCapture
|
class GSCapture
|
||||||
{
|
{
|
||||||
#ifdef _CX11_
|
|
||||||
std::recursive_mutex m_lock;
|
std::recursive_mutex m_lock;
|
||||||
#else
|
|
||||||
GSCritSec m_lock;
|
|
||||||
#endif
|
|
||||||
bool m_capturing;
|
bool m_capturing;
|
||||||
GSVector2i m_size;
|
GSVector2i m_size;
|
||||||
uint64 m_frame;
|
uint64 m_frame;
|
||||||
|
|
|
@ -409,11 +409,7 @@ void GSRenderer::VSync(int field)
|
||||||
// be noticeable). Besides, these locks are extremely short -- overhead of conditional
|
// be noticeable). Besides, these locks are extremely short -- overhead of conditional
|
||||||
// is way more expensive than just waiting for the CriticalSection in 1 of 10,000,000 tries. --air
|
// is way more expensive than just waiting for the CriticalSection in 1 of 10,000,000 tries. --air
|
||||||
|
|
||||||
#ifdef _CX11_
|
|
||||||
std::lock_guard<std::mutex> lock(m_pGSsetTitle_Crit);
|
std::lock_guard<std::mutex> lock(m_pGSsetTitle_Crit);
|
||||||
#else
|
|
||||||
GSAutoLock lock(&m_pGSsetTitle_Crit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
strncpy(m_GStitleInfoBuffer, s.c_str(), countof(m_GStitleInfoBuffer) - 1);
|
strncpy(m_GStitleInfoBuffer, s.c_str(), countof(m_GStitleInfoBuffer) - 1);
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,7 @@ public:
|
||||||
virtual void EndCapture();
|
virtual void EndCapture();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef _CX11_
|
|
||||||
std::mutex m_pGSsetTitle_Crit;
|
std::mutex m_pGSsetTitle_Crit;
|
||||||
#else
|
|
||||||
GSCritSec m_pGSsetTitle_Crit;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char m_GStitleInfoBuffer[128];
|
char m_GStitleInfoBuffer[128];
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,6 @@
|
||||||
|
|
||||||
// Require at least Visual Studio 2012
|
// Require at least Visual Studio 2012
|
||||||
#if defined(__linux__) || (defined(_MSC_VER) && (_MSC_VER >= 1700))
|
#if defined(__linux__) || (defined(_MSC_VER) && (_MSC_VER >= 1700))
|
||||||
#define _CX11_
|
|
||||||
#define ENABLE_BOOST // queue is from boost but it doesn't require a full boost install
|
#define ENABLE_BOOST // queue is from boost but it doesn't require a full boost install
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -102,14 +101,10 @@ typedef uint32 uptr;
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#ifdef _CX11_
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#endif
|
|
||||||
#if defined(__linux__) || defined(_CX11_)
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue