[vlc-devel] [PATCH 1/2] thread: winstore: Do not discard a signaled object.

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Nov 21 10:50:02 CET 2014


Hi,

On Thu, Nov 20, 2014, at 02:54 PM, Rémi Denis-Courmont wrote:
> Le 2014-11-20 16:36, Hugo Beauzée-Luyssen a écrit :
> > When a thread is cancelled yet not killable, discarding a
> > WAIT_OBJECT_X would cause the thread to wait forever, since
> > vlc_testcancel would not abort the thread.
> 
> Does that problem not affect WAIT_TIMEOUT all the same?
> 
> A cancelled thread calling msleep(CLOCK_FREQ) will sleep only 50 
> milliseconds AFAICT.
> 

If the thread isn't cancellable, it would loop again until the condition
is actually signaled, however that seems like an expected behavior to
me. The problem here is that we override the wait condition signaling.
Actually the issue could be that we are enforcing looping on spurious
wakeups, while this might be more of a caller's responsibility, just
like it's done using pthread.
I'm not sure sure I understand what you mean by the msleep part?

Regards,

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr



More information about the vlc-devel mailing list