Commit f871f2d5 authored by Alexandre Julliard's avatar Alexandre Julliard

Store thread id instead of queue handle in timer structure.

parent d8bbcb2f
......@@ -293,7 +293,7 @@ static void thread_detach(void)
if (hQueue)
{
TIMER_RemoveQueueTimers( hQueue );
TIMER_RemoveThreadTimers();
HOOK_FreeQueueHooks();
WIN_DestroyThreadWindows( GetDesktopWindow() );
QUEUE_DeleteMsgQueue();
......
......@@ -36,7 +36,7 @@ extern BOOL MSG_peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, int fl
/* timer.c */
extern void TIMER_RemoveWindowTimers( HWND hwnd );
extern void TIMER_RemoveQueueTimers( HQUEUE16 hqueue );
extern void TIMER_RemoveThreadTimers(void);
extern BOOL TIMER_IsTimerValid( HWND hwnd, UINT id, HWINDOWPROC hProc );
#endif /* __WINE_MESSAGE_H */
......@@ -36,8 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(timer);
typedef struct tagTIMER
{
HWND hwnd;
HQUEUE16 hq;
UINT16 msg; /* WM_TIMER or WM_SYSTIMER */
DWORD thread;
UINT msg; /* WM_TIMER or WM_SYSTIMER */
UINT id;
UINT timeout;
HWINDOWPROC proc;
......@@ -89,11 +89,11 @@ void TIMER_RemoveWindowTimers( HWND hwnd )
/***********************************************************************
* TIMER_RemoveQueueTimers
* TIMER_RemoveThreadTimers
*
* Remove all timers for a given queue.
* Remove all timers for the current thread.
*/
void TIMER_RemoveQueueTimers( HQUEUE16 hqueue )
void TIMER_RemoveThreadTimers(void)
{
int i;
TIMER *pTimer;
......@@ -101,7 +101,7 @@ void TIMER_RemoveQueueTimers( HQUEUE16 hqueue )
EnterCriticalSection( &csTimer );
for (i = NB_TIMERS, pTimer = TimersArray; i > 0; i--, pTimer++)
if ((pTimer->hq == hqueue) && pTimer->timeout)
if ((pTimer->thread == GetCurrentThreadId()) && pTimer->timeout)
TIMER_ClearTimer( pTimer );
LeaveCriticalSection( &csTimer );
......@@ -175,7 +175,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout,
/* Add the timer */
pTimer->hwnd = hwnd;
pTimer->hq = InitThreadInput16( 0, 0 );
pTimer->thread = GetCurrentThreadId();
pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER;
pTimer->id = id;
pTimer->timeout = timeout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment