Mercurial > dwindows
diff os2/dw.c @ 527:e0ea29c3d1eb
Fixed dw_window_pointer() so it works on Windows. Tried to fix the
timer problems on Windows, but only managed to reduce the problem and
eliminate obsolete timer code. Fixed a calling convention problem
caused by incorrect placement of the definition of API in the compat.h
header. Make dw_beep() not block on OS/2 and Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 23 Mar 2004 11:00:04 +0000 |
parents | d3ce0afa6cf5 |
children | 82a203664aa9 |
line wrap: on
line diff
--- a/os2/dw.c Tue Mar 23 10:10:27 2004 +0000 +++ b/os2/dw.c Tue Mar 23 11:00:04 2004 +0000 @@ -7615,6 +7615,18 @@ WinReleasePS(hpssrc); } +/* Run DosBeep() in a separate thread so it doesn't block */ +void _beepthread(void *data) +{ + int *info = (int *)data; + + if(data) + { + DosBeep(info[0], info[1]); + free(data); + } +} + /* * Emits a beep. * Parameters: @@ -7623,7 +7635,15 @@ */ void API dw_beep(int freq, int dur) { - DosBeep(freq, dur); + int *info = malloc(sizeof(int) * 2); + + if(info) + { + info[0] = freq; + info[1] = dur; + + _beginthread(_beepthread, NULL, 100, (void *)info); + } } /* Open a shared library and return a handle.