Store thread id instead of queue handle in timer structure.
This commit is contained in:
parent
d8bbcb2f23
commit
f871f2d528
|
@ -293,7 +293,7 @@ static void thread_detach(void)
|
||||||
|
|
||||||
if (hQueue)
|
if (hQueue)
|
||||||
{
|
{
|
||||||
TIMER_RemoveQueueTimers( hQueue );
|
TIMER_RemoveThreadTimers();
|
||||||
HOOK_FreeQueueHooks();
|
HOOK_FreeQueueHooks();
|
||||||
WIN_DestroyThreadWindows( GetDesktopWindow() );
|
WIN_DestroyThreadWindows( GetDesktopWindow() );
|
||||||
QUEUE_DeleteMsgQueue();
|
QUEUE_DeleteMsgQueue();
|
||||||
|
|
|
@ -36,7 +36,7 @@ extern BOOL MSG_peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, int fl
|
||||||
|
|
||||||
/* timer.c */
|
/* timer.c */
|
||||||
extern void TIMER_RemoveWindowTimers( HWND hwnd );
|
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 );
|
extern BOOL TIMER_IsTimerValid( HWND hwnd, UINT id, HWINDOWPROC hProc );
|
||||||
|
|
||||||
#endif /* __WINE_MESSAGE_H */
|
#endif /* __WINE_MESSAGE_H */
|
||||||
|
|
|
@ -36,8 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(timer);
|
||||||
typedef struct tagTIMER
|
typedef struct tagTIMER
|
||||||
{
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
HQUEUE16 hq;
|
DWORD thread;
|
||||||
UINT16 msg; /* WM_TIMER or WM_SYSTIMER */
|
UINT msg; /* WM_TIMER or WM_SYSTIMER */
|
||||||
UINT id;
|
UINT id;
|
||||||
UINT timeout;
|
UINT timeout;
|
||||||
HWINDOWPROC proc;
|
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;
|
int i;
|
||||||
TIMER *pTimer;
|
TIMER *pTimer;
|
||||||
|
@ -101,7 +101,7 @@ void TIMER_RemoveQueueTimers( HQUEUE16 hqueue )
|
||||||
EnterCriticalSection( &csTimer );
|
EnterCriticalSection( &csTimer );
|
||||||
|
|
||||||
for (i = NB_TIMERS, pTimer = TimersArray; i > 0; i--, pTimer++)
|
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 );
|
TIMER_ClearTimer( pTimer );
|
||||||
|
|
||||||
LeaveCriticalSection( &csTimer );
|
LeaveCriticalSection( &csTimer );
|
||||||
|
@ -175,7 +175,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout,
|
||||||
/* Add the timer */
|
/* Add the timer */
|
||||||
|
|
||||||
pTimer->hwnd = hwnd;
|
pTimer->hwnd = hwnd;
|
||||||
pTimer->hq = InitThreadInput16( 0, 0 );
|
pTimer->thread = GetCurrentThreadId();
|
||||||
pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER;
|
pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER;
|
||||||
pTimer->id = id;
|
pTimer->id = id;
|
||||||
pTimer->timeout = timeout;
|
pTimer->timeout = timeout;
|
||||||
|
|
Loading…
Reference in New Issue