Possible race condition in SDL_mixer

Using SDL 1.2.0 with the corresponding SDL_mixer on NT4, if I compile
and run the attached program in the debugger, it usually hangs while
calling Mix_CloseAudio. (sometimes it doesn’t)

If you comment out the SDL_Delay ( 1000 ), all of a sudden I don’t get
a hang.

This is happening with VC6 SP5, the program being compiled as a
console app.

Anybody else see this? I’d rather not have to put a SDL_Delay in my
program and cross my fingers.

I realize programs like this don’t come around very often, but this
really threw me off while debugging my program.

Thanks!–

Olivier A. Dagenais - Software Architect and Developer

begin 666 race.c
M(VEN8VQU9&4@/’-T9&QI8BYH/@T*(VEN8VQU9&4@/’-T9&EO+F@^#0H-“B-I
M9F1E9B!724XS, at T*(VEN8VQU9&4@/’=I;F1O=W,N:#X-“B-E;F1I9 at T*(VEN
M8VQU9&4@/$=,+V=L+F@^(” @(” O+R!(96%D97(@1FEL92!&;W(@5&AE($]P
M96Y’3#,R($QI8G)A<GD-“B-I;F-L=61E(#Q’3”]G;'4N:#X@(" @+R@2&5A
M9&5R($9I;&4 at 1F]R(%1H92!'3’4S,B!,:6)R87)Y#0HC:6YC;‘5D92 B4T1,
M+F at B#0HC:6YC;‘5D92 B4T1,7VUI>&5R+F at B#0H-"@T*:6YT(&UA:6X@"!I
M;G0 at 87)G8RP at 8VAA<B J(&%R9W8 at 6R!=(“D-“GL-”@E31$Q?4W5R9F%C92 J
M(’-C<F5E;CL-”@T
"6EF("@@4T1,7TEN:70@"!31$Q?24Y)5%]424U%4B!
M(%-$3%])3DE47T%51$E/('P at 4T1,7TE.251?5DE$14@2 (# @0T"7L-
M"@D)9G!R:6YT9B H(’-T9&5R<BP@(E5N86)L92!T;R!I;FET:6%L:7IE(5QN
M(B I.PT
"0EE>&ET("@@,2 I.PT
"7T-"@T*“7-C<F5E;B ](%-$3%]39716
M:61E;TUO9&4@" X,# L(#8P,“P@,C0L(%-$3%](5U-54D9!0T4@?”!31$Q?
M1$]50DQ%0E5&('P at 4T1,7T]014Y’3" I.PT
"6EF(”@@<V-R965N(#T]($Y5
M3$P@0T"7L-"@D)9G!R:6YT9B H(’-T9&5R<BP@(D5R<F]R.B!5;F%B;&4@
M=&@;W!E;B!V:61E;RY<;B(@3L-"@D)97AI=" H(#$@3L-"@E]#0H-"@EI
M9B H($UI>%]/<&5N075D:6@
" R,C U,"P at 055$24]?4S at L(#(L(#0P.38@
M
2 (# @0T"7L-"@D)9G!R:6YT9B H(’-T9&5R<BP@(D5R<F]R.B!5;F%B
M;&4@=&@;W!E;B!A=61I;RY<;B(@3L-"@D)97AI=" H(#$@3L-"@E]#0H-
M"@DO+R!5;F-O;6UE;G0@=&AE(&9O;&QO=VEN9RP@<F5C;VUP:6QE(&%N9"!R
M=6X@=&@;6%G:6-A;&QY(&%V;VED('1H92!H86YG:6YG+BXN#0H)+R]31$Q?
M1&5L87D@
" Q,# P("D[#0H)36EX7T-L;W-E075D:6@
" I.PT*#0H)4T1,
97U%U:70@" I.PT"7)E='5R;B P.PT*?0``
`
end

This might depend on yur project being a “console-app” (generally based
single-threaded) did you switch to multithreaded-dll in code generation ?
(Better use empty win32 app instead of console app, when compiling with
sdl).

regards,

sascha

-----Urspr?ngliche Nachricht-----Von: owner-sdl at lokigames.com [mailto:owner-sdl at lokigames.com]Im Auftrag
von Olivier Dagenais
Gesendet: Donnerstag, 12. April 2001 03:35
An: sdl at lokigames.com
Betreff: [SDL] Possible race condition in SDL_mixer

Using SDL 1.2.0 with the corresponding SDL_mixer on NT4, if I compile
and run the attached program in the debugger, it usually hangs while
calling Mix_CloseAudio. (sometimes it doesn’t)

If you comment out the SDL_Delay ( 1000 ), all of a sudden I don’t get
a hang.

This is happening with VC6 SP5, the program being compiled as a
console app.

Anybody else see this? I’d rather not have to put a SDL_Delay in my
program and cross my fingers.

I realize programs like this don’t come around very often, but this
really threw me off while debugging my program.

Thanks!

Olivier A. Dagenais - Software Architect and Developer

I am using the Multithreaded DLL version of the VC runtime, however
the “console app” is still a 32-bit Windows application, it just acts
like a Unix process in that it has redirectable stdin and stdout. (at
least, that’s how I understand it)–

Olivier A. Dagenais - Software Architect and Developer

“Sascha G?nther” <s.guenther at lives.de> wrote in message

This might depend on yur project being a “console-app” (generally
based
single-threaded) did you switch to multithreaded-dll in code
generation ?
(Better use empty win32 app instead of console app, when compiling
with
sdl).

regards,

sascha

-----Urspr?ngliche Nachricht-----
Von: owner-sdl at lokigames.com [mailto:owner-sdl at lokigames.com]Im
Auftrag
von Olivier Dagenais
Gesendet: Donnerstag, 12. April 2001 03:35
An: sdl at lokigames.com
Betreff: [SDL] Possible race condition in SDL_mixer

Using SDL 1.2.0 with the corresponding SDL_mixer on NT4, if I
compile
and run the attached program in the debugger, it usually hangs while
calling Mix_CloseAudio. (sometimes it doesn’t)

If you comment out the SDL_Delay ( 1000 ), all of a sudden I don’t
get
a hang.

This is happening with VC6 SP5, the program being compiled as a
console app.

Anybody else see this? I’d rather not have to put a SDL_Delay in my
program and cross my fingers.

I realize programs like this don’t come around very often, but this
really threw me off while debugging my program.

Thanks!

Olivier A. Dagenais - Software Architect and Developer

“Olivier Dagenais” <olivier.dagenais at canada.com> schrieb im Newsbeitrag news:9b4320$fcm$1 at ftp.lokigames.com

I am using the Multithreaded DLL version of the VC runtime, however
the “console app” is still a 32-bit Windows application, it just acts
like a Unix process in that it has redirectable stdin and stdout. (at
least, that’s how I understand it)

Jup :=)> –


Olivier A. Dagenais - Software Architect and Developer

“Sascha G?nther” <s.guenther at lives.de> wrote in message

This might depend on yur project being a “console-app” (generally
based
single-threaded) did you switch to multithreaded-dll in code
generation ?
(Better use empty win32 app instead of console app, when compiling
with
sdl).

regards,

sascha

-----Urspr?ngliche Nachricht-----
Von: owner-sdl at lokigames.com [mailto:owner-sdl at lokigames.com]Im
Auftrag
von Olivier Dagenais
Gesendet: Donnerstag, 12. April 2001 03:35
An: sdl at lokigames.com
Betreff: [SDL] Possible race condition in SDL_mixer

Using SDL 1.2.0 with the corresponding SDL_mixer on NT4, if I
compile
and run the attached program in the debugger, it usually hangs while
calling Mix_CloseAudio. (sometimes it doesn’t)

If you comment out the SDL_Delay ( 1000 ), all of a sudden I don’t
get
a hang.

This is happening with VC6 SP5, the program being compiled as a
console app.

Anybody else see this? I’d rather not have to put a SDL_Delay in my
program and cross my fingers.

I realize programs like this don’t come around very often, but this
really threw me off while debugging my program.

Thanks!

Olivier A. Dagenais - Software Architect and Developer