changeset 28776:ceafb4a24753

full_buffers and buffered_bytes must be volatile because they are used from different threads, hopefully this fixes an uninit hang. The code still relies on luck for thread-safety though.
author reimar
date Thu, 05 Mar 2009 12:25:10 +0000
parents b7100293c908
children 5d73859b9fb0
files libao2/ao_win32.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_win32.c	Thu Mar 05 07:00:45 2009 +0000
+++ b/libao2/ao_win32.c	Thu Mar 05 12:25:10 2009 +0000
@@ -88,8 +88,8 @@
 static HWAVEOUT     hWaveOut;           //handle to the waveout device
 static unsigned int buf_write=0;
 static unsigned int buf_write_pos=0;
-static int          full_buffers=0;
-static int          buffered_bytes=0;
+static volatile int full_buffers=0;
+static volatile int buffered_bytes=0;
 
 
 static ao_info_t info =