Skip to content

Commit

Permalink
Release runtime lock on Sdl.delay.
Browse files Browse the repository at this point in the history
This could deadlock the audio thread (#13) and broke
the test suite.
  • Loading branch information
dbuenzli committed Sep 26, 2016
1 parent cfffca2 commit 7bd26fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


- Release runtime lock on `Sdl.delay`.
- Reinstate support for audio callback support, `ocaml-ctypes`
is getting smarter (#13).
- Really fix signature of `Sdl.blit_surface`, thanks to
Expand Down
2 changes: 1 addition & 1 deletion src/tsdl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4664,7 +4664,7 @@ let unlock_audio_device =
(* Timer *)

let delay =
foreign "SDL_Delay" (int32_t @-> returning void)
foreign ~release_runtime_lock:true "SDL_Delay" (int32_t @-> returning void)

let get_ticks =
foreign "SDL_GetTicks" (void @-> returning int32_t)
Expand Down
4 changes: 2 additions & 2 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1248,13 +1248,13 @@ let test_audio_drivers () =
end;
done
end;
log " Quit audio";
(* log " Quit audio";
Sdl.audio_quit ();
log " Init audio with: %a" (Fmts.pp_opt Fmts.pp_str) driver;
begin match Sdl.audio_init driver with
| Error (`Msg e) -> log_err " Could not init audio: %s" e
| Ok () -> ()
end;
end; *)
()

let test_audio_devices () =
Expand Down

0 comments on commit 7bd26fb

Please sign in to comment.