1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 02:22:19 +00:00
mpv/loader
sesse 5fb74d581f Make emulated Win32 critical sections thread safe.
Earlier, cs->locked was accessed outside the mutex to get around
the problem that default pthread mutexes are not recursive
(ie., you cannot do a double-lock from the same thread), causing
a thread-safety problem, as both detected by Helgrind and showing
up in some multithreaded codecs.

The ideal solution here would be to simply use recursive pthread
mutexes, but there were concerns about reduced debuggability and
possibly portability. Thus, instead, rewrite the critical sections
to be a simple lock count (with owner) protected by a regular mutex.
Whenever a thread wants to enter the critical section and lock_count
is not 0, it sleeps on a special event that tells it when the
critical section is available.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30837 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-04 15:57:08 +00:00
..
dmo Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
dshow Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
qtx Add missing license headers to test programs for external libraries. 2010-02-03 08:32:35 +00:00
wine Add public function VideoForWindowsVersion() to the appropriate header file. 2010-02-21 23:33:03 +00:00
afl.c whitespace cosmetics: Remove all trailing whitespace. 2009-05-13 02:58:57 +00:00
com.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
debug.h
drv.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
drv.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
elfdll.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
ext.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
ext.h Get rid of pointless 'extern' keywords. 2008-12-03 23:01:03 +00:00
ldt_keeper.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
ldt_keeper.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
loader.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
module.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
pe_image.c whitespace cosmetics: Remove all trailing whitespace. 2009-05-13 02:58:57 +00:00
pe_resource.c whitespace cosmetics: Remove all trailing whitespace. 2009-05-13 02:58:57 +00:00
qt_comp.h
qt_fv.h Add missing header #includes to fix 'make checkheaders'. 2010-01-04 19:04:33 +00:00
registry.c Do not cast the results of malloc/calloc/realloc. 2010-02-26 15:01:37 +00:00
registry.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
resource.c whitespace cosmetics: Remove all trailing whitespace. 2009-05-13 02:58:57 +00:00
vfl.c cosmetics: Remove pointless empty lines at EOF. 2010-02-20 21:02:49 +00:00
win32.c Make emulated Win32 critical sections thread safe. 2010-03-04 15:57:08 +00:00
win32.h Remove disabled AVIFILE-specific preprocessor code. 2010-02-08 10:14:42 +00:00
wineacm.h Remove extern "C" declarations from loader code. 2010-02-11 14:33:57 +00:00
wrapper.h cosmetics: Remove pointless empty lines at EOF. 2010-02-20 21:02:49 +00:00
wrapper.S cosmetics: Remove pointless empty lines at EOF. 2010-02-20 21:02:49 +00:00