diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index fd3a9dd3f..0701df498 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -3458,6 +3458,7 @@ void mach64_close(void *p) svga_close(&mach64->svga); mach64->thread_run = 0; + thread_set_event(mach64->wake_fifo_thread); thread_wait(mach64->fifo_thread, -1); thread_destroy_event(mach64->wake_fifo_thread); thread_destroy_event(mach64->fifo_not_full_event); diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index 0b4cc395b..3d9102b7c 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -5035,6 +5035,7 @@ mystique_close(void *p) mystique_t *mystique = (mystique_t *)p; mystique->thread_run = 0; + thread_set_event(mystique->wake_fifo_thread); thread_wait(mystique->fifo_thread, -1); thread_destroy_event(mystique->wake_fifo_thread); thread_destroy_event(mystique->fifo_not_full_event); diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index b4092d2c7..cb1c4043a 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -6321,6 +6321,7 @@ static void s3_close(void *p) svga_close(&s3->svga); s3->thread_run = 0; + thread_set_event(s3->wake_fifo_thread); thread_wait(s3->fifo_thread, -1); thread_destroy_event(s3->wake_fifo_thread); thread_destroy_event(s3->fifo_not_full_event); diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 3652d7597..156947652 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -3920,12 +3920,14 @@ static void s3_virge_close(void *p) virge_t *virge = (virge_t *)p; virge->render_thread_run = 0; + thread_set_event(virge->wake_render_thread); thread_wait(virge->render_thread, -1); thread_destroy_event(virge->not_full_event); thread_destroy_event(virge->wake_main_thread); thread_destroy_event(virge->wake_render_thread); virge->fifo_thread_run = 0; + thread_set_event(virge->wake_fifo_thread); thread_wait(virge->fifo_thread, -1); thread_destroy_event(virge->wake_fifo_thread); thread_destroy_event(virge->fifo_not_full_event); diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 6c418c38f..519b86923 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -1256,17 +1256,22 @@ void voodoo_card_close(voodoo_t *voodoo) voodoo->fifo_thread_run = 0; + thread_set_event(voodoo->wake_fifo_thread); thread_wait(voodoo->fifo_thread, -1); voodoo->render_thread_run[0] = 0; + thread_set_event(voodoo->wake_render_thread[0]); thread_wait(voodoo->render_thread[0], -1); if (voodoo->render_threads >= 2) { voodoo->render_thread_run[1] = 0; + thread_set_event(voodoo->wake_render_thread[1]); thread_wait(voodoo->render_thread[1], -1); } if (voodoo->render_threads == 4) { voodoo->render_thread_run[2] = 0; + thread_set_event(voodoo->wake_render_thread[2]); thread_wait(voodoo->render_thread[2], -1); voodoo->render_thread_run[3] = 0; + thread_set_event(voodoo->wake_render_thread[3]); thread_wait(voodoo->render_thread[3], -1); } thread_destroy_event(voodoo->fifo_not_full_event); diff --git a/src/video/video.c b/src/video/video.c index fc311a8dd..be8963706 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -890,6 +890,7 @@ void video_close(void) { thread_run = 0; + thread_set_event(blit_data.wake_blit_thread); thread_wait(blit_data.blit_thread, -1); thread_destroy_event(blit_data.buffer_not_in_use); thread_destroy_event(blit_data.blit_complete);