From 076adeb0aa24e9bdc677435ddb6e444db58d5436 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 30 Aug 2009 12:07:04 +0000 Subject: Add method to clear all existing callbacks. Subversion-branch: /branches/opl-branch Subversion-revision: 1642 --- opl/opl_timer.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'opl/opl_timer.c') diff --git a/opl/opl_timer.c b/opl/opl_timer.c index 62ffbd37..e254a5e2 100644 --- a/opl/opl_timer.c +++ b/opl/opl_timer.c @@ -202,6 +202,13 @@ void OPL_Timer_SetCallback(unsigned int ms, opl_callback_t callback, void *data) SDL_UnlockMutex(callback_queue_mutex); } +void OPL_Timer_ClearCallbacks(void) +{ + SDL_LockMutex(callback_queue_mutex); + OPL_Queue_Clear(callback_queue); + SDL_UnlockMutex(callback_queue_mutex); +} + void OPL_Timer_Lock(void) { SDL_LockMutex(timer_mutex); -- cgit v1.2.3