[vlc-devel] [RFC] Thread cancellation on WinCE

Pierre Ynard linkfanel at yahoo.fr
Tue Nov 18 11:12:59 CET 2008

> Eventually, you need to (pretend to) implement
> WaitForMultipleObjectsEx - SleepEx and WaitForSingleObjectEx are only
> particular cases with 0 and 1 object.

Makes sense.

> > +    const HANDLE handles[2] = { nfo->cancel_event, handle };

> By inverting the order, the later code could be heavily simplified...
> This would be even more prevalent when you consider the more general
> case of WaitForMultipleObjectsEx.

This is meaningful though. The documentation [1] states that handles are
checked in the order of their array index, so with this order, checking
for cancellation happens before checking for signaled objects. This is
probably what we want. However, I looked through the documentation and I
am not sure that the original WaitForMultipleObjectsEx indeed checks for
pending APC before signaled objects.

[1] http://msdn.microsoft.com/en-us/library/ms687028(VS.85).aspx

Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."

More information about the vlc-devel mailing list