summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-04-10 13:16:15 +0200
committerwm4 <wm4@nowhere>2017-06-15 16:33:42 +0200
commitfa929eb0d0449bc88aa702f6790da324879c75a5 (patch)
tree8f666d4cf1a4388b0262eab79c8c657ad4aa1cbc /wscript
parenta3f0bf916ddf47ba4e94ad538e32e106756dedf7 (diff)
downloadmpv-fa929eb0d0449bc88aa702f6790da324879c75a5.tar.bz2
mpv-fa929eb0d0449bc88aa702f6790da324879c75a5.tar.xz
win32: pthread: avoid using TLS, simplify pthread_t
Don't use __thread, which requires heavy runtime in some cases (such as MinGW-w64, at least under some configurations, forcing you to link to its pthread runtime DLL). The pthread_t struct was needed over a simple thread ID, because pthread_join() needed to access some sort of context from pthread_t. Further, pthread_exit() and pthread_detach() need the context of the current thread, for which we relied on TLS. Replace these uses by a global thread array. This includes all threads created by the thread wrapper. Hopefully the number of threads created by mpv is low (say, below 20), and threads are not that often created or destroyed. So just keeping them in an array with linear search lookup should be reasonable.
Diffstat (limited to 'wscript')
0 files changed, 0 insertions, 0 deletions