Fix SDL UI failing to build when C++11 threads are disabled

This commit is contained in:
Alexander Babikov
2024-08-27 15:07:22 +05:00
parent bca2a38ea1
commit cf2a074dc0
4 changed files with 13 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
#include <86box/plat.h>
#include <86box/thread.h>
struct event_cpp11_ex_t {
struct event_cpp11_t {
std::condition_variable cond;
std::mutex mutex;
bool state = false;
@@ -82,14 +82,14 @@ thread_close_mutex(mutex_t *_mutex)
event_t *
thread_create_event()
{
auto ev = new event_cpp11_ex_t;
auto ev = new event_cpp11_t;
return ev;
}
int
thread_wait_event(event_t *handle, int timeout)
{
auto event = reinterpret_cast<event_cpp11_ex_t *>(handle);
auto event = reinterpret_cast<event_cpp11_t *>(handle);
auto lock = std::unique_lock<std::mutex>(event->mutex);
if (timeout < 0) {
@@ -112,7 +112,7 @@ thread_wait_event(event_t *handle, int timeout)
void
thread_set_event(event_t *handle)
{
auto event = reinterpret_cast<event_cpp11_ex_t *>(handle);
auto event = reinterpret_cast<event_cpp11_t *>(handle);
{
auto lock = std::unique_lock<std::mutex>(event->mutex);
event->state = true;
@@ -123,7 +123,7 @@ thread_set_event(event_t *handle)
void
thread_reset_event(event_t *handle)
{
auto event = reinterpret_cast<event_cpp11_ex_t *>(handle);
auto event = reinterpret_cast<event_cpp11_t *>(handle);
auto lock = std::unique_lock<std::mutex>(event->mutex);
event->state = false;
}
@@ -131,7 +131,7 @@ thread_reset_event(event_t *handle)
void
thread_destroy_event(event_t *handle)
{
auto event = reinterpret_cast<event_cpp11_ex_t *>(handle);
auto event = reinterpret_cast<event_cpp11_t *>(handle);
delete event;
}
}