[3/4] ntdll: Implement the timer queue thread.
Rob Shearman
robertshearman at gmail.com
Wed Jul 23 08:17:18 CDT 2008
Hi Dan,
2008/7/23 Dan Hipschman <dsh at linux.ucla.edu>:
> This isn't the most efficient implementation, but it works, and it should
> not be difficult to tweak. Hence, I'd rather get this version in and add
> the optimizations one at a time, in little patches. "Get it working first..."
Yes, I think you're right. I don't think it will be too hard to change
the architecture of this to that of my suggestions.
However, I have one minor nit.
> +static void WINAPI timer_queue_thread_proc(LPVOID p)
> +{
> + struct timer_queue *q = p;
> + ULONG timeout_ms;
> + BOOL done;
> +
> + timeout_ms = INFINITE;
> + while (!q->quit)
> + {
> + LARGE_INTEGER timeout;
> + DWORD ret = NtWaitForSingleObject(q->event, FALSE,
> + get_nt_timeout(&timeout, timeout_ms));
This should be NTSTATUS.
> +
> + if (ret == STATUS_TIMEOUT)
> + queue_timer_expire_next(q);
> +
> + RtlEnterCriticalSection(&q->cs);
> + timeout_ms = timer_queue_update(q);
> + RtlLeaveCriticalSection(&q->cs);
> + }
--
Rob Shearman
More information about the wine-devel
mailing list