Store thread id instead of queue handle in timer structure.

This commit is contained in:
Alexandre Julliard 2002-10-23 18:56:34 +00:00
parent d8bbcb2f23
commit f871f2d528
3 changed files with 9 additions and 9 deletions

View File

@ -293,7 +293,7 @@ static void thread_detach(void)
if (hQueue)
{
TIMER_RemoveQueueTimers( hQueue );
TIMER_RemoveThreadTimers();
HOOK_FreeQueueHooks();
WIN_DestroyThreadWindows( GetDesktopWindow() );
QUEUE_DeleteMsgQueue();

View File

@ -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 */

View File

@ -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;