summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/window.cpp')
-rw-r--r--src/osd/windows/window.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index 6111859a255..046211d4f29 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -300,7 +300,6 @@ win_window_info::win_window_info(running_machine &machine)
m_fullscreen(0),
m_fullscreen_safe(0),
m_aspect(0),
- m_render_lock(NULL),
m_target(NULL),
m_targetview(0),
m_targetorient(0),
@@ -672,9 +671,6 @@ void win_window_info::create(running_machine &machine, int index, osd_monitor_in
*last_window_ptr = window;
last_window_ptr = &window->m_next;
- // create a lock that we can use to skip blitting
- window->m_render_lock = osd_lock_alloc();
-
// load the layout
window->m_target = machine.render().target_alloc();
@@ -746,11 +742,6 @@ void win_window_info::destroy()
// free the render target
machine().render().target_free(m_target);
-
- // FIXME: move to destructor
- // free the lock
- osd_lock_free(m_render_lock);
-
}
@@ -798,9 +789,9 @@ void win_window_info::update()
// only block if we're throttled
if (machine().video().throttled() || timeGetTime() - last_update_time > 250)
- osd_lock_acquire(m_render_lock);
+ m_render_lock.lock();
else
- got_lock = osd_lock_try(m_render_lock);
+ got_lock = m_render_lock.try_lock();
// only render if we were able to get the lock
if (got_lock)
@@ -810,7 +801,7 @@ void win_window_info::update()
mtlog_add("winwindow_video_window_update: got lock");
// don't hold the lock; we just used it to see if rendering was still happening
- osd_lock_release(m_render_lock);
+ m_render_lock.unlock();
// ensure the target bounds are up-to-date, and then get the primitives
primlist = m_renderer->get_primitives();
@@ -1492,7 +1483,7 @@ void win_window_info::draw_video_contents(HDC dc, int update)
mtlog_add("draw_video_contents: begin");
mtlog_add("draw_video_contents: render lock acquire");
- osd_lock_acquire(m_render_lock);
+ std::lock_guard<std::mutex> lock(m_render_lock);
mtlog_add("draw_video_contents: render lock acquired");
// if we're iconic, don't bother
@@ -1516,7 +1507,6 @@ void win_window_info::draw_video_contents(HDC dc, int update)
}
}
- osd_lock_release(m_render_lock);
mtlog_add("draw_video_contents: render lock released");
mtlog_add("draw_video_contents: end");