summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-19 23:32:34 +0200
committerwm4 <wm4@nowhere>2014-10-19 23:48:40 +0200
commit9ba66418790f184339ad3a891f525d54459d6369 (patch)
tree0ddfa7df4ba0e7684ee9b12938c0dc07f4c5f64b /wscript
parentc6dca55665e2710163437f09c04033d4b30e2e1a (diff)
downloadmpv-9ba66418790f184339ad3a891f525d54459d6369.tar.bz2
mpv-9ba66418790f184339ad3a891f525d54459d6369.tar.xz
Set thread name for debugging
Especially with other components (libavcodec, OSX stuff), the thread list can get quite populated. Setting the thread name helps when debugging. Since this is not portable, we check the OS variants in waf configure. old-configure just gets a special-case for glibc, since doing a full check here would probably be a waste of effort.
Diffstat (limited to 'wscript')
-rw-r--r--wscript19
1 files changed, 19 insertions, 0 deletions
diff --git a/wscript b/wscript
index dc7871dca3..3eadc37aef 100644
--- a/wscript
+++ b/wscript
@@ -212,6 +212,25 @@ iconv support use --disable-iconv.",
'deps_any': [ 'os-win32', 'os-cygwin' ],
'func': check_true
}, {
+ 'name': 'glibc-thread-name',
+ 'desc': 'GLIBC API for setting thread name',
+ 'func': check_statement('pthread.h',
+ 'pthread_setname_np(pthread_self(), "ducks")',
+ use=['pthreads']),
+ }, {
+ 'name': 'osx-thread-name',
+ 'desc': 'OSX API for setting thread name',
+ 'deps_neg': [ 'glibc-thread-name' ],
+ 'func': check_statement('pthread.h',
+ 'pthread_setname_np("ducks")', use=['pthreads']),
+ }, {
+ 'name': 'bsd-thread-name',
+ 'desc': 'BSD API for setting thread name',
+ 'deps_neg': [ 'glibc-thread-name', 'osx-thread-name' ],
+ 'func': check_statement('pthread.h',
+ 'pthread_set_name_np(pthread_self(), "ducks")',
+ use=['pthreads']),
+ }, {
'name': 'bsd-fstatfs',
'desc': "BSD's fstatfs()",
'func': check_statement(['sys/param.h', 'sys/mount.h'],