diff options
author | Simon Farnsworth <simon.farnsworth@onelan.co.uk> | 2007-07-13 15:41:12 +0100 |
---|---|---|
committer | Simon Farnsworth <simon.farnsworth@onelan.co.uk> | 2007-07-13 15:41:12 +0100 |
commit | c29f5163db85b1b4097a791ca1ba96f2b52f1f04 (patch) | |
tree | 2f26e2a1ef4476387bd8ea6f1ebbbed16f02ec0d /win32 | |
parent | 1e39505760d7c54d3a435a47b1ffb05e204f8057 (diff) | |
download | xine-lib-c29f5163db85b1b4097a791ca1ba96f2b52f1f04.tar.gz xine-lib-c29f5163db85b1b4097a791ca1ba96f2b52f1f04.tar.bz2 |
Prevent ticket system deadlock when using DVB subtitles
When using DVB subtitles on an SMP machine, we see occasional lockups, which
appear to be caused by one thread acquiring the same ticket twice. Fix this,
by preventing acquire() and release() from blocking if the current thread has
already acquired the ticket.
Code sequences like the following can still block in all acquires and
releases:
ticket->acquire(...)
/* Do something */
ticket->release(...)
However, code sequences like the following, which used to deadlock if ticket
was revoked at just the wrong moment, now succeed:
ticket->acquire(...)
/* Do something */
ticket->acquire(...) /* This acquire cannot block */
/* Do something */
ticket->release(...) /* This release cannot block */
/* Do something */
ticket->release(...)
Without this patch, the inner acquire() and release() calls could block if
ticket was revoked at the wrong time. revoke() would not unblock the blocking
acquire until there have been as many release()s as acquire()s, which cannot
happen.
Diffstat (limited to 'win32')
0 files changed, 0 insertions, 0 deletions