/src/mpv/osdep/threads-posix.h
Line | Count | Source |
1 | | /* |
2 | | * This file is part of mpv. |
3 | | * |
4 | | * mpv is free software; you can redistribute it and/or |
5 | | * modify it under the terms of the GNU Lesser General Public |
6 | | * License as published by the Free Software Foundation; either |
7 | | * version 2.1 of the License, or (at your option) any later version. |
8 | | * |
9 | | * mpv is distributed in the hope that it will be useful, |
10 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | | * GNU Lesser General Public License for more details. |
13 | | * |
14 | | * You should have received a copy of the GNU Lesser General Public |
15 | | * License along with mpv. If not, see <http://www.gnu.org/licenses/>. |
16 | | */ |
17 | | |
18 | | #pragma once |
19 | | |
20 | | #include <errno.h> |
21 | | #include <pthread.h> |
22 | | #include <stdio.h> |
23 | | |
24 | | #include "common/common.h" |
25 | | #include "config.h" |
26 | | // We make use of NON-POSIX pthreads functions and certain systems |
27 | | // require this header to build without issues. (ex: OpenBSD) |
28 | | #if HAVE_BSD_THREAD_NAME |
29 | | #include <pthread_np.h> |
30 | | #endif |
31 | | #include "osdep/compiler.h" |
32 | | #include "timer.h" |
33 | | |
34 | | int mp_ptwrap_check(const char *file, int line, int res); |
35 | | int mp_ptwrap_mutex_init(const char *file, int line, pthread_mutex_t *m, |
36 | | const pthread_mutexattr_t *attr); |
37 | | int mp_ptwrap_mutex_trylock(const char *file, int line, pthread_mutex_t *m); |
38 | | |
39 | | #if HAVE_PTHREAD_DEBUG |
40 | | |
41 | | // pthread debugging wrappers. Technically, this is undefined behavior, because |
42 | | // you are not supposed to define any symbols that clash with reserved names. |
43 | | // Other than that, they should be fine. |
44 | | |
45 | | // Note: mpv normally never checks pthread error return values of certain |
46 | | // functions that should never fail. It does so because these cases would |
47 | | // be undefined behavior anyway (such as double-frees etc.). However, |
48 | | // since there are no good pthread debugging tools, these wrappers are |
49 | | // provided for the sake of debugging. They crash on unexpected errors. |
50 | | // |
51 | | // Technically, pthread_cond/mutex_init() can fail with ENOMEM. We don't |
52 | | // really respect this for normal/recursive mutex types, as due to the |
53 | | // existence of static initializers, no sane implementation could actually |
54 | | // require allocating memory. |
55 | | |
56 | | #define MP_PTWRAP(fn, ...) \ |
57 | | mp_ptwrap_check(__FILE__, __LINE__, (fn)(__VA_ARGS__)) |
58 | | |
59 | | // ISO C defines that all standard functions can be macros, except undef'ing |
60 | | // them is allowed and must make the "real" definitions available. (Whatever.) |
61 | | #undef pthread_cond_init |
62 | | #undef pthread_cond_destroy |
63 | | #undef pthread_cond_broadcast |
64 | | #undef pthread_cond_signal |
65 | | #undef pthread_cond_wait |
66 | | #undef pthread_cond_timedwait |
67 | | #undef pthread_detach |
68 | | #undef pthread_join |
69 | | #undef pthread_mutex_destroy |
70 | | #undef pthread_mutex_lock |
71 | | #undef pthread_mutex_trylock |
72 | | #undef pthread_mutex_unlock |
73 | | |
74 | | #define pthread_cond_init(...) MP_PTWRAP(pthread_cond_init, __VA_ARGS__) |
75 | | #define pthread_cond_destroy(...) MP_PTWRAP(pthread_cond_destroy, __VA_ARGS__) |
76 | | #define pthread_cond_broadcast(...) MP_PTWRAP(pthread_cond_broadcast, __VA_ARGS__) |
77 | | #define pthread_cond_signal(...) MP_PTWRAP(pthread_cond_signal, __VA_ARGS__) |
78 | | #define pthread_cond_wait(...) MP_PTWRAP(pthread_cond_wait, __VA_ARGS__) |
79 | | #define pthread_cond_timedwait(...) MP_PTWRAP(pthread_cond_timedwait, __VA_ARGS__) |
80 | | #define pthread_detach(...) MP_PTWRAP(pthread_detach, __VA_ARGS__) |
81 | | #define pthread_join(...) MP_PTWRAP(pthread_join, __VA_ARGS__) |
82 | | #define pthread_mutex_destroy(...) MP_PTWRAP(pthread_mutex_destroy, __VA_ARGS__) |
83 | | #define pthread_mutex_lock(...) MP_PTWRAP(pthread_mutex_lock, __VA_ARGS__) |
84 | | #define pthread_mutex_unlock(...) MP_PTWRAP(pthread_mutex_unlock, __VA_ARGS__) |
85 | | |
86 | | #define pthread_mutex_init(...) \ |
87 | | mp_ptwrap_mutex_init(__FILE__, __LINE__, __VA_ARGS__) |
88 | | |
89 | | #define pthread_mutex_trylock(...) \ |
90 | | mp_ptwrap_mutex_trylock(__FILE__, __LINE__, __VA_ARGS__) |
91 | | |
92 | | #endif |
93 | | |
94 | | typedef struct { |
95 | | pthread_cond_t cond; |
96 | | clockid_t clk_id; |
97 | | } mp_cond; |
98 | | |
99 | | typedef pthread_mutex_t mp_mutex; |
100 | | typedef pthread_mutex_t mp_static_mutex; |
101 | | typedef pthread_once_t mp_once; |
102 | | typedef pthread_t mp_thread_id; |
103 | | typedef pthread_t mp_thread; |
104 | | |
105 | 352k | #define MP_STATIC_COND_INITIALIZER { .cond = PTHREAD_COND_INITIALIZER, .clk_id = CLOCK_REALTIME } |
106 | 352k | #define MP_STATIC_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
107 | | #define MP_STATIC_ONCE_INITIALIZER PTHREAD_ONCE_INIT |
108 | | |
109 | | static inline int mp_mutex_init(mp_mutex *mutex) |
110 | 5.24M | { |
111 | 5.24M | #ifndef NDEBUG |
112 | 5.24M | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; |
113 | | #else |
114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; |
115 | | #endif |
116 | | |
117 | 5.24M | int ret = 0; |
118 | 5.24M | pthread_mutexattr_t attr; |
119 | 5.24M | ret = pthread_mutexattr_init(&attr); |
120 | 5.24M | if (ret != 0) |
121 | 0 | return ret; |
122 | | |
123 | 5.24M | pthread_mutexattr_settype(&attr, mutex_type); |
124 | 5.24M | ret = pthread_mutex_init(mutex, &attr); |
125 | 5.24M | pthread_mutexattr_destroy(&attr); |
126 | 5.24M | mp_assert(!ret); |
127 | 5.24M | return ret; |
128 | 5.24M | } Line | Count | Source | 110 | 494k | { | 111 | 494k | #ifndef NDEBUG | 112 | 494k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 494k | int ret = 0; | 118 | 494k | pthread_mutexattr_t attr; | 119 | 494k | ret = pthread_mutexattr_init(&attr); | 120 | 494k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 494k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 494k | ret = pthread_mutex_init(mutex, &attr); | 125 | 494k | pthread_mutexattr_destroy(&attr); | 126 | 494k | mp_assert(!ret); | 127 | 494k | return ret; | 128 | 494k | } |
Unexecuted instantiation: command.c:mp_mutex_init Unexecuted instantiation: configfiles.c:mp_mutex_init Unexecuted instantiation: external_files.c:mp_mutex_init Unexecuted instantiation: loadfile.c:mp_mutex_init Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
Unexecuted instantiation: misc.c:mp_mutex_init Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
Unexecuted instantiation: playloop.c:mp_mutex_init Unexecuted instantiation: screenshot.c:mp_mutex_init Unexecuted instantiation: scripting.c:mp_mutex_init Unexecuted instantiation: sub.c:mp_mutex_init Unexecuted instantiation: video.c:mp_mutex_init Unexecuted instantiation: clipboard.c:mp_mutex_init Unexecuted instantiation: clipboard-vo.c:mp_mutex_init Unexecuted instantiation: stream.c:mp_mutex_init Unexecuted instantiation: stream_cb.c:mp_mutex_init Unexecuted instantiation: stream_file.c:mp_mutex_init Unexecuted instantiation: stream_lavf.c:mp_mutex_init Unexecuted instantiation: stream_mpv.c:mp_mutex_init Line | Count | Source | 110 | 1.61k | { | 111 | 1.61k | #ifndef NDEBUG | 112 | 1.61k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 1.61k | int ret = 0; | 118 | 1.61k | pthread_mutexattr_t attr; | 119 | 1.61k | ret = pthread_mutexattr_init(&attr); | 120 | 1.61k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 1.61k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 1.61k | ret = pthread_mutex_init(mutex, &attr); | 125 | 1.61k | pthread_mutexattr_destroy(&attr); | 126 | 1.61k | mp_assert(!ret); | 127 | 1.61k | return ret; | 128 | 1.61k | } |
Unexecuted instantiation: osd_libass.c:mp_mutex_init Unexecuted instantiation: sd_ass.c:mp_mutex_init Unexecuted instantiation: sd_lavc.c:mp_mutex_init Unexecuted instantiation: hwdec.c:mp_mutex_init Unexecuted instantiation: mp_image.c:mp_mutex_init Unexecuted instantiation: mp_image_pool.c:mp_mutex_init Line | Count | Source | 110 | 122k | { | 111 | 122k | #ifndef NDEBUG | 112 | 122k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 122k | int ret = 0; | 118 | 122k | pthread_mutexattr_t attr; | 119 | 122k | ret = pthread_mutexattr_init(&attr); | 120 | 122k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 122k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 122k | ret = pthread_mutex_init(mutex, &attr); | 125 | 122k | pthread_mutexattr_destroy(&attr); | 126 | 122k | mp_assert(!ret); | 127 | 122k | return ret; | 128 | 122k | } |
Unexecuted instantiation: vo_gpu.c:mp_mutex_init Unexecuted instantiation: vo_image.c:mp_mutex_init Unexecuted instantiation: vo_lavc.c:mp_mutex_init Unexecuted instantiation: vo_libmpv.c:mp_mutex_init Unexecuted instantiation: vo_null.c:mp_mutex_init Unexecuted instantiation: vo_tct.c:mp_mutex_init Unexecuted instantiation: vo_kitty.c:mp_mutex_init Unexecuted instantiation: vo_gpu_next.c:mp_mutex_init Unexecuted instantiation: context.c:mp_mutex_init Unexecuted instantiation: timer.c:mp_mutex_init Unexecuted instantiation: ta.c:mp_mutex_init Unexecuted instantiation: ipc-unix.c:mp_mutex_init Unexecuted instantiation: terminal-unix.c:mp_mutex_init Unexecuted instantiation: filter_regex.c:mp_mutex_init Unexecuted instantiation: als-linux.c:mp_mutex_init Unexecuted instantiation: stream_dvb.c:mp_mutex_init Unexecuted instantiation: ra_gl.c:mp_mutex_init Unexecuted instantiation: utils.c:mp_mutex_init Unexecuted instantiation: ao_lavc.c:mp_mutex_init Line | Count | Source | 110 | 58.3k | { | 111 | 58.3k | #ifndef NDEBUG | 112 | 58.3k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 58.3k | int ret = 0; | 118 | 58.3k | pthread_mutexattr_t attr; | 119 | 58.3k | ret = pthread_mutexattr_init(&attr); | 120 | 58.3k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 58.3k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 58.3k | ret = pthread_mutex_init(mutex, &attr); | 125 | 58.3k | pthread_mutexattr_destroy(&attr); | 126 | 58.3k | mp_assert(!ret); | 127 | 58.3k | return ret; | 128 | 58.3k | } |
Unexecuted instantiation: av_log.c:mp_mutex_init encode_lavc.c:mp_mutex_init Line | Count | Source | 110 | 250 | { | 111 | 250 | #ifndef NDEBUG | 112 | 250 | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 250 | int ret = 0; | 118 | 250 | pthread_mutexattr_t attr; | 119 | 250 | ret = pthread_mutexattr_init(&attr); | 120 | 250 | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 250 | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 250 | ret = pthread_mutex_init(mutex, &attr); | 125 | 250 | pthread_mutexattr_destroy(&attr); | 126 | 250 | mp_assert(!ret); | 127 | 250 | return ret; | 128 | 250 | } |
Line | Count | Source | 110 | 611k | { | 111 | 611k | #ifndef NDEBUG | 112 | 611k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 611k | int ret = 0; | 118 | 611k | pthread_mutexattr_t attr; | 119 | 611k | ret = pthread_mutexattr_init(&attr); | 120 | 611k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 611k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 611k | ret = pthread_mutex_init(mutex, &attr); | 125 | 611k | pthread_mutexattr_destroy(&attr); | 126 | 611k | mp_assert(!ret); | 127 | 611k | return ret; | 128 | 611k | } |
Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
Line | Count | Source | 110 | 1.33M | { | 111 | 1.33M | #ifndef NDEBUG | 112 | 1.33M | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 1.33M | int ret = 0; | 118 | 1.33M | pthread_mutexattr_t attr; | 119 | 1.33M | ret = pthread_mutexattr_init(&attr); | 120 | 1.33M | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 1.33M | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 1.33M | ret = pthread_mutex_init(mutex, &attr); | 125 | 1.33M | pthread_mutexattr_destroy(&attr); | 126 | 1.33M | mp_assert(!ret); | 127 | 1.33M | return ret; | 128 | 1.33M | } |
Unexecuted instantiation: demux_lavf.c:mp_mutex_init Unexecuted instantiation: demux_mkv_timeline.c:mp_mutex_init Unexecuted instantiation: demux_playlist.c:mp_mutex_init packet_pool.c:mp_mutex_init Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
f_async_queue.c:mp_mutex_init Line | Count | Source | 110 | 29.1k | { | 111 | 29.1k | #ifndef NDEBUG | 112 | 29.1k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 29.1k | int ret = 0; | 118 | 29.1k | pthread_mutexattr_t attr; | 119 | 29.1k | ret = pthread_mutexattr_init(&attr); | 120 | 29.1k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 29.1k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 29.1k | ret = pthread_mutex_init(mutex, &attr); | 125 | 29.1k | pthread_mutexattr_destroy(&attr); | 126 | 29.1k | mp_assert(!ret); | 127 | 29.1k | return ret; | 128 | 29.1k | } |
f_decoder_wrapper.c:mp_mutex_init Line | Count | Source | 110 | 98.8k | { | 111 | 98.8k | #ifndef NDEBUG | 112 | 98.8k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 98.8k | int ret = 0; | 118 | 98.8k | pthread_mutexattr_t attr; | 119 | 98.8k | ret = pthread_mutexattr_init(&attr); | 120 | 98.8k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 98.8k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 98.8k | ret = pthread_mutex_init(mutex, &attr); | 125 | 98.8k | pthread_mutexattr_destroy(&attr); | 126 | 98.8k | mp_assert(!ret); | 127 | 98.8k | return ret; | 128 | 98.8k | } |
Unexecuted instantiation: f_lavfi.c:mp_mutex_init Unexecuted instantiation: f_output_chain.c:mp_mutex_init Line | Count | Source | 110 | 412k | { | 111 | 412k | #ifndef NDEBUG | 112 | 412k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 412k | int ret = 0; | 118 | 412k | pthread_mutexattr_t attr; | 119 | 412k | ret = pthread_mutexattr_init(&attr); | 120 | 412k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 412k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 412k | ret = pthread_mutex_init(mutex, &attr); | 125 | 412k | pthread_mutexattr_destroy(&attr); | 126 | 412k | mp_assert(!ret); | 127 | 412k | return ret; | 128 | 412k | } |
Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
Line | Count | Source | 110 | 220k | { | 111 | 220k | #ifndef NDEBUG | 112 | 220k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 220k | int ret = 0; | 118 | 220k | pthread_mutexattr_t attr; | 119 | 220k | ret = pthread_mutexattr_init(&attr); | 120 | 220k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 220k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 220k | ret = pthread_mutex_init(mutex, &attr); | 125 | 220k | pthread_mutexattr_destroy(&attr); | 126 | 220k | mp_assert(!ret); | 127 | 220k | return ret; | 128 | 220k | } |
Unexecuted instantiation: rendezvous.c:mp_mutex_init thread_pool.c:mp_mutex_init Line | Count | Source | 110 | 159k | { | 111 | 159k | #ifndef NDEBUG | 112 | 159k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 159k | int ret = 0; | 118 | 159k | pthread_mutexattr_t attr; | 119 | 159k | ret = pthread_mutexattr_init(&attr); | 120 | 159k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 159k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 159k | ret = pthread_mutex_init(mutex, &attr); | 125 | 159k | pthread_mutexattr_destroy(&attr); | 126 | 159k | mp_assert(!ret); | 127 | 159k | return ret; | 128 | 159k | } |
thread_tools.c:mp_mutex_init Line | Count | Source | 110 | 481k | { | 111 | 481k | #ifndef NDEBUG | 112 | 481k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 481k | int ret = 0; | 118 | 481k | pthread_mutexattr_t attr; | 119 | 481k | ret = pthread_mutexattr_init(&attr); | 120 | 481k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 481k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 481k | ret = pthread_mutex_init(mutex, &attr); | 125 | 481k | pthread_mutexattr_destroy(&attr); | 126 | 481k | mp_assert(!ret); | 127 | 481k | return ret; | 128 | 481k | } |
m_config_core.c:mp_mutex_init Line | Count | Source | 110 | 364k | { | 111 | 364k | #ifndef NDEBUG | 112 | 364k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 364k | int ret = 0; | 118 | 364k | pthread_mutexattr_t attr; | 119 | 364k | ret = pthread_mutexattr_init(&attr); | 120 | 364k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 364k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 364k | ret = pthread_mutex_init(mutex, &attr); | 125 | 364k | pthread_mutexattr_destroy(&attr); | 126 | 364k | mp_assert(!ret); | 127 | 364k | return ret; | 128 | 364k | } |
Unexecuted instantiation: m_config_frontend.c:mp_mutex_init Unexecuted instantiation: options.c:mp_mutex_init Unexecuted instantiation: audio.c:mp_mutex_init Unexecuted instantiation: filter_sdh.c:mp_mutex_init Unexecuted instantiation: lavc_conv.c:mp_mutex_init Line | Count | Source | 110 | 50.7k | { | 111 | 50.7k | #ifndef NDEBUG | 112 | 50.7k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 50.7k | int ret = 0; | 118 | 50.7k | pthread_mutexattr_t attr; | 119 | 50.7k | ret = pthread_mutexattr_init(&attr); | 120 | 50.7k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 50.7k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 50.7k | ret = pthread_mutex_init(mutex, &attr); | 125 | 50.7k | pthread_mutexattr_destroy(&attr); | 126 | 50.7k | mp_assert(!ret); | 127 | 50.7k | return ret; | 128 | 50.7k | } |
Unexecuted instantiation: vf_sub.c:mp_mutex_init Unexecuted instantiation: aspect.c:mp_mutex_init dr_helper.c:mp_mutex_init Line | Count | Source | 110 | 4.55k | { | 111 | 4.55k | #ifndef NDEBUG | 112 | 4.55k | int mutex_type = PTHREAD_MUTEX_ERRORCHECK; | 113 | | #else | 114 | | int mutex_type = PTHREAD_MUTEX_DEFAULT; | 115 | | #endif | 116 | | | 117 | 4.55k | int ret = 0; | 118 | 4.55k | pthread_mutexattr_t attr; | 119 | 4.55k | ret = pthread_mutexattr_init(&attr); | 120 | 4.55k | if (ret != 0) | 121 | 0 | return ret; | 122 | | | 123 | 4.55k | pthread_mutexattr_settype(&attr, mutex_type); | 124 | 4.55k | ret = pthread_mutex_init(mutex, &attr); | 125 | 4.55k | pthread_mutexattr_destroy(&attr); | 126 | 4.55k | mp_assert(!ret); | 127 | 4.55k | return ret; | 128 | 4.55k | } |
Unexecuted instantiation: libmpv_gpu.c:mp_mutex_init Unexecuted instantiation: spirv.c:mp_mutex_init Unexecuted instantiation: video_shaders.c:mp_mutex_init Unexecuted instantiation: libmpv_sw.c:mp_mutex_init Unexecuted instantiation: path-unix.c:mp_mutex_init Unexecuted instantiation: formats.c:mp_mutex_init Unexecuted instantiation: libmpv_gl.c:mp_mutex_init Unexecuted instantiation: error_diffusion.c:mp_mutex_init Unexecuted instantiation: shader_cache.c:mp_mutex_init Unexecuted instantiation: user_shaders.c:mp_mutex_init Unexecuted instantiation: common.c:mp_mutex_init Unexecuted instantiation: win_state.c:mp_mutex_init Unexecuted instantiation: threads-posix.c:mp_mutex_init |
129 | | |
130 | 5.59M | #define mp_mutex_destroy pthread_mutex_destroy |
131 | 391M | #define mp_mutex_lock pthread_mutex_lock |
132 | 0 | #define mp_mutex_trylock pthread_mutex_trylock |
133 | 391M | #define mp_mutex_unlock pthread_mutex_unlock |
134 | | |
135 | | static inline int mp_cond_init(mp_cond *cond) |
136 | 2.64M | { |
137 | 2.64M | mp_assert(cond); |
138 | | |
139 | 2.64M | int ret = 0; |
140 | 2.64M | pthread_condattr_t attr; |
141 | 2.64M | ret = pthread_condattr_init(&attr); |
142 | 2.64M | if (ret) |
143 | 0 | return ret; |
144 | | |
145 | 2.64M | cond->clk_id = CLOCK_REALTIME; |
146 | 2.64M | #if HAVE_PTHREAD_CONDATTR_SETCLOCK |
147 | 2.64M | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) |
148 | 2.64M | cond->clk_id = CLOCK_MONOTONIC; |
149 | 2.64M | #endif |
150 | | |
151 | 2.64M | ret = pthread_cond_init(&cond->cond, &attr); |
152 | 2.64M | pthread_condattr_destroy(&attr); |
153 | 2.64M | return ret; |
154 | 2.64M | } Line | Count | Source | 136 | 167k | { | 137 | 167k | mp_assert(cond); | 138 | | | 139 | 167k | int ret = 0; | 140 | 167k | pthread_condattr_t attr; | 141 | 167k | ret = pthread_condattr_init(&attr); | 142 | 167k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 167k | cond->clk_id = CLOCK_REALTIME; | 146 | 167k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 167k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 167k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 167k | #endif | 150 | | | 151 | 167k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 167k | pthread_condattr_destroy(&attr); | 153 | 167k | return ret; | 154 | 167k | } |
Unexecuted instantiation: command.c:mp_cond_init Unexecuted instantiation: configfiles.c:mp_cond_init Unexecuted instantiation: external_files.c:mp_cond_init Unexecuted instantiation: loadfile.c:mp_cond_init Unexecuted instantiation: main.c:mp_cond_init Unexecuted instantiation: misc.c:mp_cond_init Unexecuted instantiation: osd.c:mp_cond_init Unexecuted instantiation: playloop.c:mp_cond_init Unexecuted instantiation: screenshot.c:mp_cond_init Unexecuted instantiation: scripting.c:mp_cond_init Unexecuted instantiation: sub.c:mp_cond_init Unexecuted instantiation: video.c:mp_cond_init Unexecuted instantiation: clipboard.c:mp_cond_init Unexecuted instantiation: clipboard-vo.c:mp_cond_init Unexecuted instantiation: stream.c:mp_cond_init Unexecuted instantiation: stream_cb.c:mp_cond_init Unexecuted instantiation: stream_file.c:mp_cond_init Unexecuted instantiation: stream_lavf.c:mp_cond_init Unexecuted instantiation: stream_mpv.c:mp_cond_init Unexecuted instantiation: dec_sub.c:mp_cond_init Unexecuted instantiation: osd_libass.c:mp_cond_init Unexecuted instantiation: sd_ass.c:mp_cond_init Unexecuted instantiation: sd_lavc.c:mp_cond_init Unexecuted instantiation: hwdec.c:mp_cond_init Unexecuted instantiation: mp_image.c:mp_cond_init Unexecuted instantiation: mp_image_pool.c:mp_cond_init Line | Count | Source | 136 | 61.4k | { | 137 | 61.4k | mp_assert(cond); | 138 | | | 139 | 61.4k | int ret = 0; | 140 | 61.4k | pthread_condattr_t attr; | 141 | 61.4k | ret = pthread_condattr_init(&attr); | 142 | 61.4k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 61.4k | cond->clk_id = CLOCK_REALTIME; | 146 | 61.4k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 61.4k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 61.4k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 61.4k | #endif | 150 | | | 151 | 61.4k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 61.4k | pthread_condattr_destroy(&attr); | 153 | 61.4k | return ret; | 154 | 61.4k | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_init Unexecuted instantiation: vo_image.c:mp_cond_init Unexecuted instantiation: vo_lavc.c:mp_cond_init Unexecuted instantiation: vo_libmpv.c:mp_cond_init Unexecuted instantiation: vo_null.c:mp_cond_init Unexecuted instantiation: vo_tct.c:mp_cond_init Unexecuted instantiation: vo_kitty.c:mp_cond_init Unexecuted instantiation: vo_gpu_next.c:mp_cond_init Unexecuted instantiation: context.c:mp_cond_init Unexecuted instantiation: timer.c:mp_cond_init Unexecuted instantiation: ta.c:mp_cond_init Unexecuted instantiation: ipc-unix.c:mp_cond_init Unexecuted instantiation: terminal-unix.c:mp_cond_init Unexecuted instantiation: filter_regex.c:mp_cond_init Unexecuted instantiation: als-linux.c:mp_cond_init Unexecuted instantiation: stream_dvb.c:mp_cond_init Unexecuted instantiation: ra_gl.c:mp_cond_init Unexecuted instantiation: utils.c:mp_cond_init Unexecuted instantiation: ao_lavc.c:mp_cond_init Line | Count | Source | 136 | 58.3k | { | 137 | 58.3k | mp_assert(cond); | 138 | | | 139 | 58.3k | int ret = 0; | 140 | 58.3k | pthread_condattr_t attr; | 141 | 58.3k | ret = pthread_condattr_init(&attr); | 142 | 58.3k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 58.3k | cond->clk_id = CLOCK_REALTIME; | 146 | 58.3k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 58.3k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 58.3k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 58.3k | #endif | 150 | | | 151 | 58.3k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 58.3k | pthread_condattr_destroy(&attr); | 153 | 58.3k | return ret; | 154 | 58.3k | } |
Unexecuted instantiation: av_log.c:mp_cond_init Unexecuted instantiation: encode_lavc.c:mp_cond_init Line | Count | Source | 136 | 159k | { | 137 | 159k | mp_assert(cond); | 138 | | | 139 | 159k | int ret = 0; | 140 | 159k | pthread_condattr_t attr; | 141 | 159k | ret = pthread_condattr_init(&attr); | 142 | 159k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 159k | cond->clk_id = CLOCK_REALTIME; | 146 | 159k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 159k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 159k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 159k | #endif | 150 | | | 151 | 159k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 159k | pthread_condattr_destroy(&attr); | 153 | 159k | return ret; | 154 | 159k | } |
Unexecuted instantiation: stats.c:mp_cond_init Line | Count | Source | 136 | 1.33M | { | 137 | 1.33M | mp_assert(cond); | 138 | | | 139 | 1.33M | int ret = 0; | 140 | 1.33M | pthread_condattr_t attr; | 141 | 1.33M | ret = pthread_condattr_init(&attr); | 142 | 1.33M | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 1.33M | cond->clk_id = CLOCK_REALTIME; | 146 | 1.33M | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 1.33M | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 1.33M | cond->clk_id = CLOCK_MONOTONIC; | 149 | 1.33M | #endif | 150 | | | 151 | 1.33M | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 1.33M | pthread_condattr_destroy(&attr); | 153 | 1.33M | return ret; | 154 | 1.33M | } |
Unexecuted instantiation: demux_lavf.c:mp_cond_init Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_init Unexecuted instantiation: demux_playlist.c:mp_cond_init Unexecuted instantiation: packet_pool.c:mp_cond_init Unexecuted instantiation: f_async_queue.c:mp_cond_init Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_init Unexecuted instantiation: f_lavfi.c:mp_cond_init Unexecuted instantiation: f_output_chain.c:mp_cond_init Unexecuted instantiation: filter.c:mp_cond_init Unexecuted instantiation: input.c:mp_cond_init Line | Count | Source | 136 | 220k | { | 137 | 220k | mp_assert(cond); | 138 | | | 139 | 220k | int ret = 0; | 140 | 220k | pthread_condattr_t attr; | 141 | 220k | ret = pthread_condattr_init(&attr); | 142 | 220k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 220k | cond->clk_id = CLOCK_REALTIME; | 146 | 220k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 220k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 220k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 220k | #endif | 150 | | | 151 | 220k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 220k | pthread_condattr_destroy(&attr); | 153 | 220k | return ret; | 154 | 220k | } |
Unexecuted instantiation: rendezvous.c:mp_cond_init thread_pool.c:mp_cond_init Line | Count | Source | 136 | 159k | { | 137 | 159k | mp_assert(cond); | 138 | | | 139 | 159k | int ret = 0; | 140 | 159k | pthread_condattr_t attr; | 141 | 159k | ret = pthread_condattr_init(&attr); | 142 | 159k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 159k | cond->clk_id = CLOCK_REALTIME; | 146 | 159k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 159k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 159k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 159k | #endif | 150 | | | 151 | 159k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 159k | pthread_condattr_destroy(&attr); | 153 | 159k | return ret; | 154 | 159k | } |
thread_tools.c:mp_cond_init Line | Count | Source | 136 | 481k | { | 137 | 481k | mp_assert(cond); | 138 | | | 139 | 481k | int ret = 0; | 140 | 481k | pthread_condattr_t attr; | 141 | 481k | ret = pthread_condattr_init(&attr); | 142 | 481k | if (ret) | 143 | 0 | return ret; | 144 | | | 145 | 481k | cond->clk_id = CLOCK_REALTIME; | 146 | 481k | #if HAVE_PTHREAD_CONDATTR_SETCLOCK | 147 | 481k | if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) | 148 | 481k | cond->clk_id = CLOCK_MONOTONIC; | 149 | 481k | #endif | 150 | | | 151 | 481k | ret = pthread_cond_init(&cond->cond, &attr); | 152 | 481k | pthread_condattr_destroy(&attr); | 153 | 481k | return ret; | 154 | 481k | } |
Unexecuted instantiation: m_config_core.c:mp_cond_init Unexecuted instantiation: m_config_frontend.c:mp_cond_init Unexecuted instantiation: options.c:mp_cond_init Unexecuted instantiation: audio.c:mp_cond_init Unexecuted instantiation: filter_sdh.c:mp_cond_init Unexecuted instantiation: lavc_conv.c:mp_cond_init Unexecuted instantiation: vd_lavc.c:mp_cond_init Unexecuted instantiation: vf_sub.c:mp_cond_init Unexecuted instantiation: aspect.c:mp_cond_init Unexecuted instantiation: dr_helper.c:mp_cond_init Unexecuted instantiation: libmpv_gpu.c:mp_cond_init Unexecuted instantiation: spirv.c:mp_cond_init Unexecuted instantiation: video_shaders.c:mp_cond_init Unexecuted instantiation: libmpv_sw.c:mp_cond_init Unexecuted instantiation: path-unix.c:mp_cond_init Unexecuted instantiation: formats.c:mp_cond_init Unexecuted instantiation: libmpv_gl.c:mp_cond_init Unexecuted instantiation: error_diffusion.c:mp_cond_init Unexecuted instantiation: shader_cache.c:mp_cond_init Unexecuted instantiation: user_shaders.c:mp_cond_init Unexecuted instantiation: common.c:mp_cond_init Unexecuted instantiation: win_state.c:mp_cond_init Unexecuted instantiation: threads-posix.c:mp_cond_init |
155 | | |
156 | | static inline int mp_cond_destroy(mp_cond *cond) |
157 | 2.99M | { |
158 | 2.99M | mp_assert(cond); |
159 | 2.99M | return pthread_cond_destroy(&cond->cond); |
160 | 2.99M | } Line | Count | Source | 157 | 167k | { | 158 | 167k | mp_assert(cond); | 159 | 167k | return pthread_cond_destroy(&cond->cond); | 160 | 167k | } |
Unexecuted instantiation: command.c:mp_cond_destroy Unexecuted instantiation: configfiles.c:mp_cond_destroy Unexecuted instantiation: external_files.c:mp_cond_destroy Unexecuted instantiation: loadfile.c:mp_cond_destroy Unexecuted instantiation: main.c:mp_cond_destroy Unexecuted instantiation: misc.c:mp_cond_destroy Unexecuted instantiation: osd.c:mp_cond_destroy Unexecuted instantiation: playloop.c:mp_cond_destroy Unexecuted instantiation: screenshot.c:mp_cond_destroy Unexecuted instantiation: scripting.c:mp_cond_destroy Unexecuted instantiation: sub.c:mp_cond_destroy Unexecuted instantiation: video.c:mp_cond_destroy Unexecuted instantiation: clipboard.c:mp_cond_destroy Unexecuted instantiation: clipboard-vo.c:mp_cond_destroy Unexecuted instantiation: stream.c:mp_cond_destroy Unexecuted instantiation: stream_cb.c:mp_cond_destroy Unexecuted instantiation: stream_file.c:mp_cond_destroy Unexecuted instantiation: stream_lavf.c:mp_cond_destroy Unexecuted instantiation: stream_mpv.c:mp_cond_destroy Unexecuted instantiation: dec_sub.c:mp_cond_destroy Unexecuted instantiation: osd_libass.c:mp_cond_destroy Unexecuted instantiation: sd_ass.c:mp_cond_destroy Unexecuted instantiation: sd_lavc.c:mp_cond_destroy Unexecuted instantiation: hwdec.c:mp_cond_destroy Unexecuted instantiation: mp_image.c:mp_cond_destroy Unexecuted instantiation: mp_image_pool.c:mp_cond_destroy Line | Count | Source | 157 | 61.4k | { | 158 | 61.4k | mp_assert(cond); | 159 | 61.4k | return pthread_cond_destroy(&cond->cond); | 160 | 61.4k | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_destroy Unexecuted instantiation: vo_image.c:mp_cond_destroy Unexecuted instantiation: vo_lavc.c:mp_cond_destroy Unexecuted instantiation: vo_libmpv.c:mp_cond_destroy Unexecuted instantiation: vo_null.c:mp_cond_destroy Unexecuted instantiation: vo_tct.c:mp_cond_destroy Unexecuted instantiation: vo_kitty.c:mp_cond_destroy Unexecuted instantiation: vo_gpu_next.c:mp_cond_destroy Unexecuted instantiation: context.c:mp_cond_destroy Unexecuted instantiation: timer.c:mp_cond_destroy Unexecuted instantiation: ta.c:mp_cond_destroy Unexecuted instantiation: ipc-unix.c:mp_cond_destroy Unexecuted instantiation: terminal-unix.c:mp_cond_destroy Unexecuted instantiation: filter_regex.c:mp_cond_destroy Unexecuted instantiation: als-linux.c:mp_cond_destroy Unexecuted instantiation: stream_dvb.c:mp_cond_destroy Unexecuted instantiation: ra_gl.c:mp_cond_destroy Unexecuted instantiation: utils.c:mp_cond_destroy Unexecuted instantiation: ao_lavc.c:mp_cond_destroy Line | Count | Source | 157 | 58.7k | { | 158 | 58.7k | mp_assert(cond); | 159 | 58.7k | return pthread_cond_destroy(&cond->cond); | 160 | 58.7k | } |
Unexecuted instantiation: av_log.c:mp_cond_destroy Unexecuted instantiation: encode_lavc.c:mp_cond_destroy Line | Count | Source | 157 | 159k | { | 158 | 159k | mp_assert(cond); | 159 | 159k | return pthread_cond_destroy(&cond->cond); | 160 | 159k | } |
Unexecuted instantiation: stats.c:mp_cond_destroy Line | Count | Source | 157 | 1.33M | { | 158 | 1.33M | mp_assert(cond); | 159 | 1.33M | return pthread_cond_destroy(&cond->cond); | 160 | 1.33M | } |
Unexecuted instantiation: demux_lavf.c:mp_cond_destroy Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_destroy Unexecuted instantiation: demux_playlist.c:mp_cond_destroy Unexecuted instantiation: packet_pool.c:mp_cond_destroy Unexecuted instantiation: f_async_queue.c:mp_cond_destroy Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_destroy Unexecuted instantiation: f_lavfi.c:mp_cond_destroy Unexecuted instantiation: f_output_chain.c:mp_cond_destroy Unexecuted instantiation: filter.c:mp_cond_destroy Unexecuted instantiation: input.c:mp_cond_destroy dispatch.c:mp_cond_destroy Line | Count | Source | 157 | 220k | { | 158 | 220k | mp_assert(cond); | 159 | 220k | return pthread_cond_destroy(&cond->cond); | 160 | 220k | } |
Unexecuted instantiation: rendezvous.c:mp_cond_destroy thread_pool.c:mp_cond_destroy Line | Count | Source | 157 | 159k | { | 158 | 159k | mp_assert(cond); | 159 | 159k | return pthread_cond_destroy(&cond->cond); | 160 | 159k | } |
thread_tools.c:mp_cond_destroy Line | Count | Source | 157 | 834k | { | 158 | 834k | mp_assert(cond); | 159 | 834k | return pthread_cond_destroy(&cond->cond); | 160 | 834k | } |
Unexecuted instantiation: m_config_core.c:mp_cond_destroy Unexecuted instantiation: m_config_frontend.c:mp_cond_destroy Unexecuted instantiation: options.c:mp_cond_destroy Unexecuted instantiation: audio.c:mp_cond_destroy Unexecuted instantiation: filter_sdh.c:mp_cond_destroy Unexecuted instantiation: lavc_conv.c:mp_cond_destroy Unexecuted instantiation: vd_lavc.c:mp_cond_destroy Unexecuted instantiation: vf_sub.c:mp_cond_destroy Unexecuted instantiation: aspect.c:mp_cond_destroy Unexecuted instantiation: dr_helper.c:mp_cond_destroy Unexecuted instantiation: libmpv_gpu.c:mp_cond_destroy Unexecuted instantiation: spirv.c:mp_cond_destroy Unexecuted instantiation: video_shaders.c:mp_cond_destroy Unexecuted instantiation: libmpv_sw.c:mp_cond_destroy Unexecuted instantiation: path-unix.c:mp_cond_destroy Unexecuted instantiation: formats.c:mp_cond_destroy Unexecuted instantiation: libmpv_gl.c:mp_cond_destroy Unexecuted instantiation: error_diffusion.c:mp_cond_destroy Unexecuted instantiation: shader_cache.c:mp_cond_destroy Unexecuted instantiation: user_shaders.c:mp_cond_destroy Unexecuted instantiation: common.c:mp_cond_destroy Unexecuted instantiation: win_state.c:mp_cond_destroy Unexecuted instantiation: threads-posix.c:mp_cond_destroy |
161 | | |
162 | | static inline int mp_cond_broadcast(mp_cond *cond) |
163 | 14.8M | { |
164 | 14.8M | mp_assert(cond); |
165 | 14.8M | return pthread_cond_broadcast(&cond->cond); |
166 | 14.8M | } client.c:mp_cond_broadcast Line | Count | Source | 163 | 854k | { | 164 | 854k | mp_assert(cond); | 165 | 854k | return pthread_cond_broadcast(&cond->cond); | 166 | 854k | } |
Unexecuted instantiation: command.c:mp_cond_broadcast Unexecuted instantiation: configfiles.c:mp_cond_broadcast Unexecuted instantiation: external_files.c:mp_cond_broadcast Unexecuted instantiation: loadfile.c:mp_cond_broadcast Unexecuted instantiation: main.c:mp_cond_broadcast Unexecuted instantiation: misc.c:mp_cond_broadcast Unexecuted instantiation: osd.c:mp_cond_broadcast Unexecuted instantiation: playloop.c:mp_cond_broadcast Unexecuted instantiation: screenshot.c:mp_cond_broadcast Unexecuted instantiation: scripting.c:mp_cond_broadcast Unexecuted instantiation: sub.c:mp_cond_broadcast Unexecuted instantiation: video.c:mp_cond_broadcast Unexecuted instantiation: clipboard.c:mp_cond_broadcast Unexecuted instantiation: clipboard-vo.c:mp_cond_broadcast Unexecuted instantiation: stream.c:mp_cond_broadcast Unexecuted instantiation: stream_cb.c:mp_cond_broadcast Unexecuted instantiation: stream_file.c:mp_cond_broadcast Unexecuted instantiation: stream_lavf.c:mp_cond_broadcast Unexecuted instantiation: stream_mpv.c:mp_cond_broadcast Unexecuted instantiation: dec_sub.c:mp_cond_broadcast Unexecuted instantiation: osd_libass.c:mp_cond_broadcast Unexecuted instantiation: sd_ass.c:mp_cond_broadcast Unexecuted instantiation: sd_lavc.c:mp_cond_broadcast Unexecuted instantiation: hwdec.c:mp_cond_broadcast Unexecuted instantiation: mp_image.c:mp_cond_broadcast Unexecuted instantiation: mp_image_pool.c:mp_cond_broadcast Line | Count | Source | 163 | 1.64M | { | 164 | 1.64M | mp_assert(cond); | 165 | 1.64M | return pthread_cond_broadcast(&cond->cond); | 166 | 1.64M | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_broadcast Unexecuted instantiation: vo_image.c:mp_cond_broadcast Unexecuted instantiation: vo_lavc.c:mp_cond_broadcast Unexecuted instantiation: vo_libmpv.c:mp_cond_broadcast Unexecuted instantiation: vo_null.c:mp_cond_broadcast Unexecuted instantiation: vo_tct.c:mp_cond_broadcast Unexecuted instantiation: vo_kitty.c:mp_cond_broadcast Unexecuted instantiation: vo_gpu_next.c:mp_cond_broadcast Unexecuted instantiation: context.c:mp_cond_broadcast Unexecuted instantiation: timer.c:mp_cond_broadcast Unexecuted instantiation: ta.c:mp_cond_broadcast Unexecuted instantiation: ipc-unix.c:mp_cond_broadcast Unexecuted instantiation: terminal-unix.c:mp_cond_broadcast Unexecuted instantiation: filter_regex.c:mp_cond_broadcast Unexecuted instantiation: als-linux.c:mp_cond_broadcast Unexecuted instantiation: stream_dvb.c:mp_cond_broadcast Unexecuted instantiation: ra_gl.c:mp_cond_broadcast Unexecuted instantiation: utils.c:mp_cond_broadcast Unexecuted instantiation: ao_lavc.c:mp_cond_broadcast buffer.c:mp_cond_broadcast Line | Count | Source | 163 | 2.84M | { | 164 | 2.84M | mp_assert(cond); | 165 | 2.84M | return pthread_cond_broadcast(&cond->cond); | 166 | 2.84M | } |
Unexecuted instantiation: av_log.c:mp_cond_broadcast Unexecuted instantiation: encode_lavc.c:mp_cond_broadcast Unexecuted instantiation: msg.c:mp_cond_broadcast Unexecuted instantiation: stats.c:mp_cond_broadcast Unexecuted instantiation: demux.c:mp_cond_broadcast Unexecuted instantiation: demux_lavf.c:mp_cond_broadcast Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_broadcast Unexecuted instantiation: demux_playlist.c:mp_cond_broadcast Unexecuted instantiation: packet_pool.c:mp_cond_broadcast Unexecuted instantiation: f_async_queue.c:mp_cond_broadcast Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_broadcast Unexecuted instantiation: f_lavfi.c:mp_cond_broadcast Unexecuted instantiation: f_output_chain.c:mp_cond_broadcast Unexecuted instantiation: filter.c:mp_cond_broadcast Unexecuted instantiation: input.c:mp_cond_broadcast dispatch.c:mp_cond_broadcast Line | Count | Source | 163 | 8.60M | { | 164 | 8.60M | mp_assert(cond); | 165 | 8.60M | return pthread_cond_broadcast(&cond->cond); | 166 | 8.60M | } |
rendezvous.c:mp_cond_broadcast Line | Count | Source | 163 | 61.3k | { | 164 | 61.3k | mp_assert(cond); | 165 | 61.3k | return pthread_cond_broadcast(&cond->cond); | 166 | 61.3k | } |
thread_pool.c:mp_cond_broadcast Line | Count | Source | 163 | 159k | { | 164 | 159k | mp_assert(cond); | 165 | 159k | return pthread_cond_broadcast(&cond->cond); | 166 | 159k | } |
thread_tools.c:mp_cond_broadcast Line | Count | Source | 163 | 690k | { | 164 | 690k | mp_assert(cond); | 165 | 690k | return pthread_cond_broadcast(&cond->cond); | 166 | 690k | } |
Unexecuted instantiation: m_config_core.c:mp_cond_broadcast Unexecuted instantiation: m_config_frontend.c:mp_cond_broadcast Unexecuted instantiation: options.c:mp_cond_broadcast Unexecuted instantiation: audio.c:mp_cond_broadcast Unexecuted instantiation: filter_sdh.c:mp_cond_broadcast Unexecuted instantiation: lavc_conv.c:mp_cond_broadcast Unexecuted instantiation: vd_lavc.c:mp_cond_broadcast Unexecuted instantiation: vf_sub.c:mp_cond_broadcast Unexecuted instantiation: aspect.c:mp_cond_broadcast Unexecuted instantiation: dr_helper.c:mp_cond_broadcast Unexecuted instantiation: libmpv_gpu.c:mp_cond_broadcast Unexecuted instantiation: spirv.c:mp_cond_broadcast Unexecuted instantiation: video_shaders.c:mp_cond_broadcast Unexecuted instantiation: libmpv_sw.c:mp_cond_broadcast Unexecuted instantiation: path-unix.c:mp_cond_broadcast Unexecuted instantiation: formats.c:mp_cond_broadcast Unexecuted instantiation: libmpv_gl.c:mp_cond_broadcast Unexecuted instantiation: error_diffusion.c:mp_cond_broadcast Unexecuted instantiation: shader_cache.c:mp_cond_broadcast Unexecuted instantiation: user_shaders.c:mp_cond_broadcast Unexecuted instantiation: common.c:mp_cond_broadcast Unexecuted instantiation: win_state.c:mp_cond_broadcast Unexecuted instantiation: threads-posix.c:mp_cond_broadcast |
167 | | |
168 | | static inline int mp_cond_signal(mp_cond *cond) |
169 | 6.46M | { |
170 | 6.46M | mp_assert(cond); |
171 | 6.46M | return pthread_cond_signal(&cond->cond); |
172 | 6.46M | } Unexecuted instantiation: client.c:mp_cond_signal Unexecuted instantiation: command.c:mp_cond_signal Unexecuted instantiation: configfiles.c:mp_cond_signal Unexecuted instantiation: external_files.c:mp_cond_signal Unexecuted instantiation: loadfile.c:mp_cond_signal Unexecuted instantiation: main.c:mp_cond_signal Unexecuted instantiation: misc.c:mp_cond_signal Unexecuted instantiation: osd.c:mp_cond_signal Unexecuted instantiation: playloop.c:mp_cond_signal Unexecuted instantiation: screenshot.c:mp_cond_signal Unexecuted instantiation: scripting.c:mp_cond_signal Unexecuted instantiation: sub.c:mp_cond_signal Unexecuted instantiation: video.c:mp_cond_signal Unexecuted instantiation: clipboard.c:mp_cond_signal Unexecuted instantiation: clipboard-vo.c:mp_cond_signal Unexecuted instantiation: stream.c:mp_cond_signal Unexecuted instantiation: stream_cb.c:mp_cond_signal Unexecuted instantiation: stream_file.c:mp_cond_signal Unexecuted instantiation: stream_lavf.c:mp_cond_signal Unexecuted instantiation: stream_mpv.c:mp_cond_signal Unexecuted instantiation: dec_sub.c:mp_cond_signal Unexecuted instantiation: osd_libass.c:mp_cond_signal Unexecuted instantiation: sd_ass.c:mp_cond_signal Unexecuted instantiation: sd_lavc.c:mp_cond_signal Unexecuted instantiation: hwdec.c:mp_cond_signal Unexecuted instantiation: mp_image.c:mp_cond_signal Unexecuted instantiation: mp_image_pool.c:mp_cond_signal Unexecuted instantiation: vo.c:mp_cond_signal Unexecuted instantiation: vo_gpu.c:mp_cond_signal Unexecuted instantiation: vo_image.c:mp_cond_signal Unexecuted instantiation: vo_lavc.c:mp_cond_signal Unexecuted instantiation: vo_libmpv.c:mp_cond_signal Unexecuted instantiation: vo_null.c:mp_cond_signal Unexecuted instantiation: vo_tct.c:mp_cond_signal Unexecuted instantiation: vo_kitty.c:mp_cond_signal Unexecuted instantiation: vo_gpu_next.c:mp_cond_signal Unexecuted instantiation: context.c:mp_cond_signal Unexecuted instantiation: timer.c:mp_cond_signal Unexecuted instantiation: ta.c:mp_cond_signal Unexecuted instantiation: ipc-unix.c:mp_cond_signal Unexecuted instantiation: terminal-unix.c:mp_cond_signal Unexecuted instantiation: filter_regex.c:mp_cond_signal Unexecuted instantiation: als-linux.c:mp_cond_signal Unexecuted instantiation: stream_dvb.c:mp_cond_signal Unexecuted instantiation: ra_gl.c:mp_cond_signal Unexecuted instantiation: utils.c:mp_cond_signal Unexecuted instantiation: ao_lavc.c:mp_cond_signal Unexecuted instantiation: buffer.c:mp_cond_signal Unexecuted instantiation: av_log.c:mp_cond_signal Unexecuted instantiation: encode_lavc.c:mp_cond_signal Unexecuted instantiation: msg.c:mp_cond_signal Unexecuted instantiation: stats.c:mp_cond_signal Line | Count | Source | 169 | 6.02M | { | 170 | 6.02M | mp_assert(cond); | 171 | 6.02M | return pthread_cond_signal(&cond->cond); | 172 | 6.02M | } |
Unexecuted instantiation: demux_lavf.c:mp_cond_signal Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_signal Unexecuted instantiation: demux_playlist.c:mp_cond_signal Unexecuted instantiation: packet_pool.c:mp_cond_signal Unexecuted instantiation: f_async_queue.c:mp_cond_signal Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_signal Unexecuted instantiation: f_lavfi.c:mp_cond_signal Unexecuted instantiation: f_output_chain.c:mp_cond_signal Unexecuted instantiation: filter.c:mp_cond_signal Unexecuted instantiation: input.c:mp_cond_signal Unexecuted instantiation: dispatch.c:mp_cond_signal Unexecuted instantiation: rendezvous.c:mp_cond_signal thread_pool.c:mp_cond_signal Line | Count | Source | 169 | 87.6k | { | 170 | 87.6k | mp_assert(cond); | 171 | 87.6k | return pthread_cond_signal(&cond->cond); | 172 | 87.6k | } |
thread_tools.c:mp_cond_signal Line | Count | Source | 169 | 352k | { | 170 | 352k | mp_assert(cond); | 171 | 352k | return pthread_cond_signal(&cond->cond); | 172 | 352k | } |
Unexecuted instantiation: m_config_core.c:mp_cond_signal Unexecuted instantiation: m_config_frontend.c:mp_cond_signal Unexecuted instantiation: options.c:mp_cond_signal Unexecuted instantiation: audio.c:mp_cond_signal Unexecuted instantiation: filter_sdh.c:mp_cond_signal Unexecuted instantiation: lavc_conv.c:mp_cond_signal Unexecuted instantiation: vd_lavc.c:mp_cond_signal Unexecuted instantiation: vf_sub.c:mp_cond_signal Unexecuted instantiation: aspect.c:mp_cond_signal Unexecuted instantiation: dr_helper.c:mp_cond_signal Unexecuted instantiation: libmpv_gpu.c:mp_cond_signal Unexecuted instantiation: spirv.c:mp_cond_signal Unexecuted instantiation: video_shaders.c:mp_cond_signal Unexecuted instantiation: libmpv_sw.c:mp_cond_signal Unexecuted instantiation: path-unix.c:mp_cond_signal Unexecuted instantiation: formats.c:mp_cond_signal Unexecuted instantiation: libmpv_gl.c:mp_cond_signal Unexecuted instantiation: error_diffusion.c:mp_cond_signal Unexecuted instantiation: shader_cache.c:mp_cond_signal Unexecuted instantiation: user_shaders.c:mp_cond_signal Unexecuted instantiation: common.c:mp_cond_signal Unexecuted instantiation: win_state.c:mp_cond_signal Unexecuted instantiation: threads-posix.c:mp_cond_signal |
173 | | |
174 | | static inline int mp_cond_wait(mp_cond *cond, mp_mutex *mutex) |
175 | 1.95M | { |
176 | 1.95M | mp_assert(cond); |
177 | 1.95M | return pthread_cond_wait(&cond->cond, mutex); |
178 | 1.95M | } Unexecuted instantiation: client.c:mp_cond_wait Unexecuted instantiation: command.c:mp_cond_wait Unexecuted instantiation: configfiles.c:mp_cond_wait Unexecuted instantiation: external_files.c:mp_cond_wait Unexecuted instantiation: loadfile.c:mp_cond_wait Unexecuted instantiation: main.c:mp_cond_wait Unexecuted instantiation: misc.c:mp_cond_wait Unexecuted instantiation: osd.c:mp_cond_wait Unexecuted instantiation: playloop.c:mp_cond_wait Unexecuted instantiation: screenshot.c:mp_cond_wait Unexecuted instantiation: scripting.c:mp_cond_wait Unexecuted instantiation: sub.c:mp_cond_wait Unexecuted instantiation: video.c:mp_cond_wait Unexecuted instantiation: clipboard.c:mp_cond_wait Unexecuted instantiation: clipboard-vo.c:mp_cond_wait Unexecuted instantiation: stream.c:mp_cond_wait Unexecuted instantiation: stream_cb.c:mp_cond_wait Unexecuted instantiation: stream_file.c:mp_cond_wait Unexecuted instantiation: stream_lavf.c:mp_cond_wait Unexecuted instantiation: stream_mpv.c:mp_cond_wait Unexecuted instantiation: dec_sub.c:mp_cond_wait Unexecuted instantiation: osd_libass.c:mp_cond_wait Unexecuted instantiation: sd_ass.c:mp_cond_wait Unexecuted instantiation: sd_lavc.c:mp_cond_wait Unexecuted instantiation: hwdec.c:mp_cond_wait Unexecuted instantiation: mp_image.c:mp_cond_wait Unexecuted instantiation: mp_image_pool.c:mp_cond_wait Line | Count | Source | 175 | 23.5k | { | 176 | 23.5k | mp_assert(cond); | 177 | 23.5k | return pthread_cond_wait(&cond->cond, mutex); | 178 | 23.5k | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_wait Unexecuted instantiation: vo_image.c:mp_cond_wait Unexecuted instantiation: vo_lavc.c:mp_cond_wait Unexecuted instantiation: vo_libmpv.c:mp_cond_wait Unexecuted instantiation: vo_null.c:mp_cond_wait Unexecuted instantiation: vo_tct.c:mp_cond_wait Unexecuted instantiation: vo_kitty.c:mp_cond_wait Unexecuted instantiation: vo_gpu_next.c:mp_cond_wait Unexecuted instantiation: context.c:mp_cond_wait Unexecuted instantiation: timer.c:mp_cond_wait Unexecuted instantiation: ta.c:mp_cond_wait Unexecuted instantiation: ipc-unix.c:mp_cond_wait Unexecuted instantiation: terminal-unix.c:mp_cond_wait Unexecuted instantiation: filter_regex.c:mp_cond_wait Unexecuted instantiation: als-linux.c:mp_cond_wait Unexecuted instantiation: stream_dvb.c:mp_cond_wait Unexecuted instantiation: ra_gl.c:mp_cond_wait Unexecuted instantiation: utils.c:mp_cond_wait Unexecuted instantiation: ao_lavc.c:mp_cond_wait Unexecuted instantiation: buffer.c:mp_cond_wait Unexecuted instantiation: av_log.c:mp_cond_wait Unexecuted instantiation: encode_lavc.c:mp_cond_wait Unexecuted instantiation: msg.c:mp_cond_wait Unexecuted instantiation: stats.c:mp_cond_wait Unexecuted instantiation: demux.c:mp_cond_wait Unexecuted instantiation: demux_lavf.c:mp_cond_wait Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_wait Unexecuted instantiation: demux_playlist.c:mp_cond_wait Unexecuted instantiation: packet_pool.c:mp_cond_wait Unexecuted instantiation: f_async_queue.c:mp_cond_wait Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_wait Unexecuted instantiation: f_lavfi.c:mp_cond_wait Unexecuted instantiation: f_output_chain.c:mp_cond_wait Unexecuted instantiation: filter.c:mp_cond_wait Unexecuted instantiation: input.c:mp_cond_wait Line | Count | Source | 175 | 1.78M | { | 176 | 1.78M | mp_assert(cond); | 177 | 1.78M | return pthread_cond_wait(&cond->cond, mutex); | 178 | 1.78M | } |
rendezvous.c:mp_cond_wait Line | Count | Source | 175 | 61.3k | { | 176 | 61.3k | mp_assert(cond); | 177 | 61.3k | return pthread_cond_wait(&cond->cond, mutex); | 178 | 61.3k | } |
thread_pool.c:mp_cond_wait Line | Count | Source | 175 | 87.6k | { | 176 | 87.6k | mp_assert(cond); | 177 | 87.6k | return pthread_cond_wait(&cond->cond, mutex); | 178 | 87.6k | } |
Unexecuted instantiation: thread_tools.c:mp_cond_wait Unexecuted instantiation: m_config_core.c:mp_cond_wait Unexecuted instantiation: m_config_frontend.c:mp_cond_wait Unexecuted instantiation: options.c:mp_cond_wait Unexecuted instantiation: audio.c:mp_cond_wait Unexecuted instantiation: filter_sdh.c:mp_cond_wait Unexecuted instantiation: lavc_conv.c:mp_cond_wait Unexecuted instantiation: vd_lavc.c:mp_cond_wait Unexecuted instantiation: vf_sub.c:mp_cond_wait Unexecuted instantiation: aspect.c:mp_cond_wait Unexecuted instantiation: dr_helper.c:mp_cond_wait Unexecuted instantiation: libmpv_gpu.c:mp_cond_wait Unexecuted instantiation: spirv.c:mp_cond_wait Unexecuted instantiation: video_shaders.c:mp_cond_wait Unexecuted instantiation: libmpv_sw.c:mp_cond_wait Unexecuted instantiation: path-unix.c:mp_cond_wait Unexecuted instantiation: formats.c:mp_cond_wait Unexecuted instantiation: libmpv_gl.c:mp_cond_wait Unexecuted instantiation: error_diffusion.c:mp_cond_wait Unexecuted instantiation: shader_cache.c:mp_cond_wait Unexecuted instantiation: user_shaders.c:mp_cond_wait Unexecuted instantiation: common.c:mp_cond_wait Unexecuted instantiation: win_state.c:mp_cond_wait Unexecuted instantiation: threads-posix.c:mp_cond_wait |
179 | | |
180 | | static inline int mp_cond_timedwait(mp_cond *cond, mp_mutex *mutex, int64_t timeout) |
181 | 7.41M | { |
182 | 7.41M | mp_assert(cond); |
183 | | |
184 | 7.41M | timeout = MPMAX(0, timeout); |
185 | | // consider anything above 1000 days as infinity |
186 | 7.41M | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) |
187 | 820k | return pthread_cond_wait(&cond->cond, mutex); |
188 | | |
189 | 6.59M | struct timespec ts; |
190 | 6.59M | clock_gettime(cond->clk_id, &ts); |
191 | 6.59M | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); |
192 | 6.59M | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); |
193 | 6.59M | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { |
194 | 3.51M | ts.tv_nsec -= MP_TIME_S_TO_NS(1); |
195 | 3.51M | ts.tv_sec++; |
196 | 3.51M | } |
197 | | |
198 | 6.59M | return pthread_cond_timedwait(&cond->cond, mutex, &ts); |
199 | 7.41M | } client.c:mp_cond_timedwait Line | Count | Source | 181 | 754k | { | 182 | 754k | mp_assert(cond); | 183 | | | 184 | 754k | timeout = MPMAX(0, timeout); | 185 | | // consider anything above 1000 days as infinity | 186 | 754k | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) | 187 | 577k | return pthread_cond_wait(&cond->cond, mutex); | 188 | | | 189 | 176k | struct timespec ts; | 190 | 176k | clock_gettime(cond->clk_id, &ts); | 191 | 176k | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); | 192 | 176k | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); | 193 | 176k | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { | 194 | 168k | ts.tv_nsec -= MP_TIME_S_TO_NS(1); | 195 | 168k | ts.tv_sec++; | 196 | 168k | } | 197 | | | 198 | 176k | return pthread_cond_timedwait(&cond->cond, mutex, &ts); | 199 | 754k | } |
Unexecuted instantiation: command.c:mp_cond_timedwait Unexecuted instantiation: configfiles.c:mp_cond_timedwait Unexecuted instantiation: external_files.c:mp_cond_timedwait Unexecuted instantiation: loadfile.c:mp_cond_timedwait Unexecuted instantiation: main.c:mp_cond_timedwait Unexecuted instantiation: misc.c:mp_cond_timedwait Unexecuted instantiation: osd.c:mp_cond_timedwait Unexecuted instantiation: playloop.c:mp_cond_timedwait Unexecuted instantiation: screenshot.c:mp_cond_timedwait Unexecuted instantiation: scripting.c:mp_cond_timedwait Unexecuted instantiation: sub.c:mp_cond_timedwait Unexecuted instantiation: video.c:mp_cond_timedwait Unexecuted instantiation: clipboard.c:mp_cond_timedwait Unexecuted instantiation: clipboard-vo.c:mp_cond_timedwait Unexecuted instantiation: stream.c:mp_cond_timedwait Unexecuted instantiation: stream_cb.c:mp_cond_timedwait Unexecuted instantiation: stream_file.c:mp_cond_timedwait Unexecuted instantiation: stream_lavf.c:mp_cond_timedwait Unexecuted instantiation: stream_mpv.c:mp_cond_timedwait Unexecuted instantiation: dec_sub.c:mp_cond_timedwait Unexecuted instantiation: osd_libass.c:mp_cond_timedwait Unexecuted instantiation: sd_ass.c:mp_cond_timedwait Unexecuted instantiation: sd_lavc.c:mp_cond_timedwait Unexecuted instantiation: hwdec.c:mp_cond_timedwait Unexecuted instantiation: mp_image.c:mp_cond_timedwait Unexecuted instantiation: mp_image_pool.c:mp_cond_timedwait Line | Count | Source | 181 | 916k | { | 182 | 916k | mp_assert(cond); | 183 | | | 184 | 916k | timeout = MPMAX(0, timeout); | 185 | | // consider anything above 1000 days as infinity | 186 | 916k | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) | 187 | 24 | return pthread_cond_wait(&cond->cond, mutex); | 188 | | | 189 | 916k | struct timespec ts; | 190 | 916k | clock_gettime(cond->clk_id, &ts); | 191 | 916k | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); | 192 | 916k | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); | 193 | 916k | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { | 194 | 916k | ts.tv_nsec -= MP_TIME_S_TO_NS(1); | 195 | 916k | ts.tv_sec++; | 196 | 916k | } | 197 | | | 198 | 916k | return pthread_cond_timedwait(&cond->cond, mutex, &ts); | 199 | 916k | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_timedwait Unexecuted instantiation: vo_image.c:mp_cond_timedwait Unexecuted instantiation: vo_lavc.c:mp_cond_timedwait Unexecuted instantiation: vo_libmpv.c:mp_cond_timedwait Unexecuted instantiation: vo_null.c:mp_cond_timedwait Unexecuted instantiation: vo_tct.c:mp_cond_timedwait Unexecuted instantiation: vo_kitty.c:mp_cond_timedwait Unexecuted instantiation: vo_gpu_next.c:mp_cond_timedwait Unexecuted instantiation: context.c:mp_cond_timedwait Unexecuted instantiation: timer.c:mp_cond_timedwait Unexecuted instantiation: ta.c:mp_cond_timedwait Unexecuted instantiation: ipc-unix.c:mp_cond_timedwait Unexecuted instantiation: terminal-unix.c:mp_cond_timedwait Unexecuted instantiation: filter_regex.c:mp_cond_timedwait Unexecuted instantiation: als-linux.c:mp_cond_timedwait Unexecuted instantiation: stream_dvb.c:mp_cond_timedwait Unexecuted instantiation: ra_gl.c:mp_cond_timedwait Unexecuted instantiation: utils.c:mp_cond_timedwait Unexecuted instantiation: ao_lavc.c:mp_cond_timedwait buffer.c:mp_cond_timedwait Line | Count | Source | 181 | 2.39M | { | 182 | 2.39M | mp_assert(cond); | 183 | | | 184 | 2.39M | timeout = MPMAX(0, timeout); | 185 | | // consider anything above 1000 days as infinity | 186 | 2.39M | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) | 187 | 64.2k | return pthread_cond_wait(&cond->cond, mutex); | 188 | | | 189 | 2.32M | struct timespec ts; | 190 | 2.32M | clock_gettime(cond->clk_id, &ts); | 191 | 2.32M | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); | 192 | 2.32M | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); | 193 | 2.32M | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { | 194 | 113k | ts.tv_nsec -= MP_TIME_S_TO_NS(1); | 195 | 113k | ts.tv_sec++; | 196 | 113k | } | 197 | | | 198 | 2.32M | return pthread_cond_timedwait(&cond->cond, mutex, &ts); | 199 | 2.39M | } |
Unexecuted instantiation: av_log.c:mp_cond_timedwait Unexecuted instantiation: encode_lavc.c:mp_cond_timedwait Unexecuted instantiation: msg.c:mp_cond_timedwait Unexecuted instantiation: stats.c:mp_cond_timedwait demux.c:mp_cond_timedwait Line | Count | Source | 181 | 2.44M | { | 182 | 2.44M | mp_assert(cond); | 183 | | | 184 | 2.44M | timeout = MPMAX(0, timeout); | 185 | | // consider anything above 1000 days as infinity | 186 | 2.44M | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) | 187 | 168k | return pthread_cond_wait(&cond->cond, mutex); | 188 | | | 189 | 2.27M | struct timespec ts; | 190 | 2.27M | clock_gettime(cond->clk_id, &ts); | 191 | 2.27M | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); | 192 | 2.27M | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); | 193 | 2.27M | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { | 194 | 2.27M | ts.tv_nsec -= MP_TIME_S_TO_NS(1); | 195 | 2.27M | ts.tv_sec++; | 196 | 2.27M | } | 197 | | | 198 | 2.27M | return pthread_cond_timedwait(&cond->cond, mutex, &ts); | 199 | 2.44M | } |
Unexecuted instantiation: demux_lavf.c:mp_cond_timedwait Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_timedwait Unexecuted instantiation: demux_playlist.c:mp_cond_timedwait Unexecuted instantiation: packet_pool.c:mp_cond_timedwait Unexecuted instantiation: f_async_queue.c:mp_cond_timedwait Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_timedwait Unexecuted instantiation: f_lavfi.c:mp_cond_timedwait Unexecuted instantiation: f_output_chain.c:mp_cond_timedwait Unexecuted instantiation: filter.c:mp_cond_timedwait Unexecuted instantiation: input.c:mp_cond_timedwait dispatch.c:mp_cond_timedwait Line | Count | Source | 181 | 904k | { | 182 | 904k | mp_assert(cond); | 183 | | | 184 | 904k | timeout = MPMAX(0, timeout); | 185 | | // consider anything above 1000 days as infinity | 186 | 904k | if (timeout > MP_TIME_S_TO_NS(1000 * 24 * 60 * 60)) | 187 | 10.7k | return pthread_cond_wait(&cond->cond, mutex); | 188 | | | 189 | 893k | struct timespec ts; | 190 | 893k | clock_gettime(cond->clk_id, &ts); | 191 | 893k | ts.tv_sec += timeout / MP_TIME_S_TO_NS(1); | 192 | 893k | ts.tv_nsec += timeout % MP_TIME_S_TO_NS(1); | 193 | 893k | if (ts.tv_nsec >= MP_TIME_S_TO_NS(1)) { | 194 | 42.1k | ts.tv_nsec -= MP_TIME_S_TO_NS(1); | 195 | 42.1k | ts.tv_sec++; | 196 | 42.1k | } | 197 | | | 198 | 893k | return pthread_cond_timedwait(&cond->cond, mutex, &ts); | 199 | 904k | } |
Unexecuted instantiation: rendezvous.c:mp_cond_timedwait Unexecuted instantiation: thread_pool.c:mp_cond_timedwait Unexecuted instantiation: thread_tools.c:mp_cond_timedwait Unexecuted instantiation: m_config_core.c:mp_cond_timedwait Unexecuted instantiation: m_config_frontend.c:mp_cond_timedwait Unexecuted instantiation: options.c:mp_cond_timedwait Unexecuted instantiation: audio.c:mp_cond_timedwait Unexecuted instantiation: filter_sdh.c:mp_cond_timedwait Unexecuted instantiation: lavc_conv.c:mp_cond_timedwait Unexecuted instantiation: vd_lavc.c:mp_cond_timedwait Unexecuted instantiation: vf_sub.c:mp_cond_timedwait Unexecuted instantiation: aspect.c:mp_cond_timedwait Unexecuted instantiation: dr_helper.c:mp_cond_timedwait Unexecuted instantiation: libmpv_gpu.c:mp_cond_timedwait Unexecuted instantiation: spirv.c:mp_cond_timedwait Unexecuted instantiation: video_shaders.c:mp_cond_timedwait Unexecuted instantiation: libmpv_sw.c:mp_cond_timedwait Unexecuted instantiation: path-unix.c:mp_cond_timedwait Unexecuted instantiation: formats.c:mp_cond_timedwait Unexecuted instantiation: libmpv_gl.c:mp_cond_timedwait Unexecuted instantiation: error_diffusion.c:mp_cond_timedwait Unexecuted instantiation: shader_cache.c:mp_cond_timedwait Unexecuted instantiation: user_shaders.c:mp_cond_timedwait Unexecuted instantiation: common.c:mp_cond_timedwait Unexecuted instantiation: win_state.c:mp_cond_timedwait Unexecuted instantiation: threads-posix.c:mp_cond_timedwait |
200 | | |
201 | | static inline int mp_cond_timedwait_until(mp_cond *cond, mp_mutex *mutex, int64_t until) |
202 | 5.01M | { |
203 | 5.01M | return mp_cond_timedwait(cond, mutex, until - mp_time_ns()); |
204 | 5.01M | } client.c:mp_cond_timedwait_until Line | Count | Source | 202 | 754k | { | 203 | 754k | return mp_cond_timedwait(cond, mutex, until - mp_time_ns()); | 204 | 754k | } |
Unexecuted instantiation: command.c:mp_cond_timedwait_until Unexecuted instantiation: configfiles.c:mp_cond_timedwait_until Unexecuted instantiation: external_files.c:mp_cond_timedwait_until Unexecuted instantiation: loadfile.c:mp_cond_timedwait_until Unexecuted instantiation: main.c:mp_cond_timedwait_until Unexecuted instantiation: misc.c:mp_cond_timedwait_until Unexecuted instantiation: osd.c:mp_cond_timedwait_until Unexecuted instantiation: playloop.c:mp_cond_timedwait_until Unexecuted instantiation: screenshot.c:mp_cond_timedwait_until Unexecuted instantiation: scripting.c:mp_cond_timedwait_until Unexecuted instantiation: sub.c:mp_cond_timedwait_until Unexecuted instantiation: video.c:mp_cond_timedwait_until Unexecuted instantiation: clipboard.c:mp_cond_timedwait_until Unexecuted instantiation: clipboard-vo.c:mp_cond_timedwait_until Unexecuted instantiation: stream.c:mp_cond_timedwait_until Unexecuted instantiation: stream_cb.c:mp_cond_timedwait_until Unexecuted instantiation: stream_file.c:mp_cond_timedwait_until Unexecuted instantiation: stream_lavf.c:mp_cond_timedwait_until Unexecuted instantiation: stream_mpv.c:mp_cond_timedwait_until Unexecuted instantiation: dec_sub.c:mp_cond_timedwait_until Unexecuted instantiation: osd_libass.c:mp_cond_timedwait_until Unexecuted instantiation: sd_ass.c:mp_cond_timedwait_until Unexecuted instantiation: sd_lavc.c:mp_cond_timedwait_until Unexecuted instantiation: hwdec.c:mp_cond_timedwait_until Unexecuted instantiation: mp_image.c:mp_cond_timedwait_until Unexecuted instantiation: mp_image_pool.c:mp_cond_timedwait_until vo.c:mp_cond_timedwait_until Line | Count | Source | 202 | 916k | { | 203 | 916k | return mp_cond_timedwait(cond, mutex, until - mp_time_ns()); | 204 | 916k | } |
Unexecuted instantiation: vo_gpu.c:mp_cond_timedwait_until Unexecuted instantiation: vo_image.c:mp_cond_timedwait_until Unexecuted instantiation: vo_lavc.c:mp_cond_timedwait_until Unexecuted instantiation: vo_libmpv.c:mp_cond_timedwait_until Unexecuted instantiation: vo_null.c:mp_cond_timedwait_until Unexecuted instantiation: vo_tct.c:mp_cond_timedwait_until Unexecuted instantiation: vo_kitty.c:mp_cond_timedwait_until Unexecuted instantiation: vo_gpu_next.c:mp_cond_timedwait_until Unexecuted instantiation: context.c:mp_cond_timedwait_until Unexecuted instantiation: timer.c:mp_cond_timedwait_until Unexecuted instantiation: ta.c:mp_cond_timedwait_until Unexecuted instantiation: ipc-unix.c:mp_cond_timedwait_until Unexecuted instantiation: terminal-unix.c:mp_cond_timedwait_until Unexecuted instantiation: filter_regex.c:mp_cond_timedwait_until Unexecuted instantiation: als-linux.c:mp_cond_timedwait_until Unexecuted instantiation: stream_dvb.c:mp_cond_timedwait_until Unexecuted instantiation: ra_gl.c:mp_cond_timedwait_until Unexecuted instantiation: utils.c:mp_cond_timedwait_until Unexecuted instantiation: ao_lavc.c:mp_cond_timedwait_until Unexecuted instantiation: buffer.c:mp_cond_timedwait_until Unexecuted instantiation: av_log.c:mp_cond_timedwait_until Unexecuted instantiation: encode_lavc.c:mp_cond_timedwait_until Unexecuted instantiation: msg.c:mp_cond_timedwait_until Unexecuted instantiation: stats.c:mp_cond_timedwait_until demux.c:mp_cond_timedwait_until Line | Count | Source | 202 | 2.44M | { | 203 | 2.44M | return mp_cond_timedwait(cond, mutex, until - mp_time_ns()); | 204 | 2.44M | } |
Unexecuted instantiation: demux_lavf.c:mp_cond_timedwait_until Unexecuted instantiation: demux_mkv_timeline.c:mp_cond_timedwait_until Unexecuted instantiation: demux_playlist.c:mp_cond_timedwait_until Unexecuted instantiation: packet_pool.c:mp_cond_timedwait_until Unexecuted instantiation: f_async_queue.c:mp_cond_timedwait_until Unexecuted instantiation: f_decoder_wrapper.c:mp_cond_timedwait_until Unexecuted instantiation: f_lavfi.c:mp_cond_timedwait_until Unexecuted instantiation: f_output_chain.c:mp_cond_timedwait_until Unexecuted instantiation: filter.c:mp_cond_timedwait_until Unexecuted instantiation: input.c:mp_cond_timedwait_until dispatch.c:mp_cond_timedwait_until Line | Count | Source | 202 | 904k | { | 203 | 904k | return mp_cond_timedwait(cond, mutex, until - mp_time_ns()); | 204 | 904k | } |
Unexecuted instantiation: rendezvous.c:mp_cond_timedwait_until Unexecuted instantiation: thread_pool.c:mp_cond_timedwait_until Unexecuted instantiation: thread_tools.c:mp_cond_timedwait_until Unexecuted instantiation: m_config_core.c:mp_cond_timedwait_until Unexecuted instantiation: m_config_frontend.c:mp_cond_timedwait_until Unexecuted instantiation: options.c:mp_cond_timedwait_until Unexecuted instantiation: audio.c:mp_cond_timedwait_until Unexecuted instantiation: filter_sdh.c:mp_cond_timedwait_until Unexecuted instantiation: lavc_conv.c:mp_cond_timedwait_until Unexecuted instantiation: vd_lavc.c:mp_cond_timedwait_until Unexecuted instantiation: vf_sub.c:mp_cond_timedwait_until Unexecuted instantiation: aspect.c:mp_cond_timedwait_until Unexecuted instantiation: dr_helper.c:mp_cond_timedwait_until Unexecuted instantiation: libmpv_gpu.c:mp_cond_timedwait_until Unexecuted instantiation: spirv.c:mp_cond_timedwait_until Unexecuted instantiation: video_shaders.c:mp_cond_timedwait_until Unexecuted instantiation: libmpv_sw.c:mp_cond_timedwait_until Unexecuted instantiation: path-unix.c:mp_cond_timedwait_until Unexecuted instantiation: formats.c:mp_cond_timedwait_until Unexecuted instantiation: libmpv_gl.c:mp_cond_timedwait_until Unexecuted instantiation: error_diffusion.c:mp_cond_timedwait_until Unexecuted instantiation: shader_cache.c:mp_cond_timedwait_until Unexecuted instantiation: user_shaders.c:mp_cond_timedwait_until Unexecuted instantiation: common.c:mp_cond_timedwait_until Unexecuted instantiation: win_state.c:mp_cond_timedwait_until Unexecuted instantiation: threads-posix.c:mp_cond_timedwait_until |
205 | | |
206 | 220k | #define mp_exec_once pthread_once |
207 | | |
208 | | #define MP_THREAD_VOID void * |
209 | 554k | #define MP_THREAD_RETURN() return NULL |
210 | | |
211 | 554k | #define mp_thread_create(t, f, a) pthread_create(t, NULL, f, a) |
212 | 545k | #define mp_thread_join(t) pthread_join(t, NULL) |
213 | 8.47k | #define mp_thread_detach pthread_detach |
214 | 5.35M | #define mp_thread_current_id pthread_self |
215 | 0 | #define mp_thread_id_equal(a, b) ((a) == (b)) |
216 | | #define mp_thread_get_id(thread) (thread) |
217 | | |
218 | | static inline void mp_thread_set_name(const char *name) |
219 | 561k | { |
220 | 561k | #if HAVE_GLIBC_THREAD_NAME |
221 | 561k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { |
222 | 4.35k | char tname[16] = {0}; // glibc-checked kernel limit |
223 | 4.35k | strncpy(tname, name, sizeof(tname) - 1); |
224 | 4.35k | pthread_setname_np(pthread_self(), tname); |
225 | 4.35k | } |
226 | | #elif HAVE_BSD_THREAD_NAME |
227 | | pthread_set_name_np(pthread_self(), name); |
228 | | #elif HAVE_MAC_THREAD_NAME |
229 | | pthread_setname_np(name); |
230 | | #endif |
231 | 561k | } client.c:mp_thread_set_name Line | Count | Source | 219 | 159k | { | 220 | 159k | #if HAVE_GLIBC_THREAD_NAME | 221 | 159k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 159k | } |
Unexecuted instantiation: command.c:mp_thread_set_name Unexecuted instantiation: configfiles.c:mp_thread_set_name Unexecuted instantiation: external_files.c:mp_thread_set_name loadfile.c:mp_thread_set_name Line | Count | Source | 219 | 118k | { | 220 | 118k | #if HAVE_GLIBC_THREAD_NAME | 221 | 118k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 118k | } |
Unexecuted instantiation: main.c:mp_thread_set_name Unexecuted instantiation: misc.c:mp_thread_set_name Unexecuted instantiation: osd.c:mp_thread_set_name Unexecuted instantiation: playloop.c:mp_thread_set_name Unexecuted instantiation: screenshot.c:mp_thread_set_name scripting.c:mp_thread_set_name Line | Count | Source | 219 | 8.47k | { | 220 | 8.47k | #if HAVE_GLIBC_THREAD_NAME | 221 | 8.47k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 2.24k | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 2.24k | strncpy(tname, name, sizeof(tname) - 1); | 224 | 2.24k | pthread_setname_np(pthread_self(), tname); | 225 | 2.24k | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 8.47k | } |
Unexecuted instantiation: sub.c:mp_thread_set_name Unexecuted instantiation: video.c:mp_thread_set_name Unexecuted instantiation: clipboard.c:mp_thread_set_name Unexecuted instantiation: clipboard-vo.c:mp_thread_set_name Unexecuted instantiation: stream.c:mp_thread_set_name Unexecuted instantiation: stream_cb.c:mp_thread_set_name Unexecuted instantiation: stream_file.c:mp_thread_set_name Unexecuted instantiation: stream_lavf.c:mp_thread_set_name Unexecuted instantiation: stream_mpv.c:mp_thread_set_name Unexecuted instantiation: dec_sub.c:mp_thread_set_name Unexecuted instantiation: osd_libass.c:mp_thread_set_name Unexecuted instantiation: sd_ass.c:mp_thread_set_name Unexecuted instantiation: sd_lavc.c:mp_thread_set_name Unexecuted instantiation: hwdec.c:mp_thread_set_name Unexecuted instantiation: mp_image.c:mp_thread_set_name Unexecuted instantiation: mp_image_pool.c:mp_thread_set_name Line | Count | Source | 219 | 61.3k | { | 220 | 61.3k | #if HAVE_GLIBC_THREAD_NAME | 221 | 61.3k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 61.3k | } |
Unexecuted instantiation: vo_gpu.c:mp_thread_set_name Unexecuted instantiation: vo_image.c:mp_thread_set_name Unexecuted instantiation: vo_lavc.c:mp_thread_set_name Unexecuted instantiation: vo_libmpv.c:mp_thread_set_name Unexecuted instantiation: vo_null.c:mp_thread_set_name Unexecuted instantiation: vo_tct.c:mp_thread_set_name Unexecuted instantiation: vo_kitty.c:mp_thread_set_name Unexecuted instantiation: vo_gpu_next.c:mp_thread_set_name Unexecuted instantiation: context.c:mp_thread_set_name Unexecuted instantiation: timer.c:mp_thread_set_name Unexecuted instantiation: ta.c:mp_thread_set_name ipc-unix.c:mp_thread_set_name Line | Count | Source | 219 | 7.58k | { | 220 | 7.58k | #if HAVE_GLIBC_THREAD_NAME | 221 | 7.58k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 2.11k | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 2.11k | strncpy(tname, name, sizeof(tname) - 1); | 224 | 2.11k | pthread_setname_np(pthread_self(), tname); | 225 | 2.11k | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 7.58k | } |
terminal-unix.c:mp_thread_set_name Line | Count | Source | 219 | 9 | { | 220 | 9 | #if HAVE_GLIBC_THREAD_NAME | 221 | 9 | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 9 | } |
Unexecuted instantiation: filter_regex.c:mp_thread_set_name Unexecuted instantiation: als-linux.c:mp_thread_set_name Unexecuted instantiation: stream_dvb.c:mp_thread_set_name Unexecuted instantiation: ra_gl.c:mp_thread_set_name Unexecuted instantiation: utils.c:mp_thread_set_name Unexecuted instantiation: ao_lavc.c:mp_thread_set_name buffer.c:mp_thread_set_name Line | Count | Source | 219 | 29.1k | { | 220 | 29.1k | #if HAVE_GLIBC_THREAD_NAME | 221 | 29.1k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 29.1k | } |
Unexecuted instantiation: av_log.c:mp_thread_set_name Unexecuted instantiation: encode_lavc.c:mp_thread_set_name Unexecuted instantiation: msg.c:mp_thread_set_name Unexecuted instantiation: stats.c:mp_thread_set_name demux.c:mp_thread_set_name Line | Count | Source | 219 | 90.3k | { | 220 | 90.3k | #if HAVE_GLIBC_THREAD_NAME | 221 | 90.3k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 90.3k | } |
Unexecuted instantiation: demux_lavf.c:mp_thread_set_name Unexecuted instantiation: demux_mkv_timeline.c:mp_thread_set_name Unexecuted instantiation: demux_playlist.c:mp_thread_set_name Unexecuted instantiation: packet_pool.c:mp_thread_set_name Unexecuted instantiation: f_async_queue.c:mp_thread_set_name Unexecuted instantiation: f_decoder_wrapper.c:mp_thread_set_name Unexecuted instantiation: f_lavfi.c:mp_thread_set_name Unexecuted instantiation: f_output_chain.c:mp_thread_set_name Unexecuted instantiation: filter.c:mp_thread_set_name Unexecuted instantiation: input.c:mp_thread_set_name Unexecuted instantiation: dispatch.c:mp_thread_set_name Unexecuted instantiation: rendezvous.c:mp_thread_set_name thread_pool.c:mp_thread_set_name Line | Count | Source | 219 | 87.4k | { | 220 | 87.4k | #if HAVE_GLIBC_THREAD_NAME | 221 | 87.4k | if (pthread_setname_np(pthread_self(), name) == ERANGE) { | 222 | 0 | char tname[16] = {0}; // glibc-checked kernel limit | 223 | 0 | strncpy(tname, name, sizeof(tname) - 1); | 224 | 0 | pthread_setname_np(pthread_self(), tname); | 225 | 0 | } | 226 | | #elif HAVE_BSD_THREAD_NAME | 227 | | pthread_set_name_np(pthread_self(), name); | 228 | | #elif HAVE_MAC_THREAD_NAME | 229 | | pthread_setname_np(name); | 230 | | #endif | 231 | 87.4k | } |
Unexecuted instantiation: thread_tools.c:mp_thread_set_name Unexecuted instantiation: m_config_core.c:mp_thread_set_name Unexecuted instantiation: m_config_frontend.c:mp_thread_set_name Unexecuted instantiation: options.c:mp_thread_set_name Unexecuted instantiation: audio.c:mp_thread_set_name Unexecuted instantiation: filter_sdh.c:mp_thread_set_name Unexecuted instantiation: lavc_conv.c:mp_thread_set_name Unexecuted instantiation: vd_lavc.c:mp_thread_set_name Unexecuted instantiation: vf_sub.c:mp_thread_set_name Unexecuted instantiation: aspect.c:mp_thread_set_name Unexecuted instantiation: dr_helper.c:mp_thread_set_name Unexecuted instantiation: libmpv_gpu.c:mp_thread_set_name Unexecuted instantiation: spirv.c:mp_thread_set_name Unexecuted instantiation: video_shaders.c:mp_thread_set_name Unexecuted instantiation: libmpv_sw.c:mp_thread_set_name Unexecuted instantiation: path-unix.c:mp_thread_set_name Unexecuted instantiation: formats.c:mp_thread_set_name Unexecuted instantiation: libmpv_gl.c:mp_thread_set_name Unexecuted instantiation: error_diffusion.c:mp_thread_set_name Unexecuted instantiation: shader_cache.c:mp_thread_set_name Unexecuted instantiation: user_shaders.c:mp_thread_set_name Unexecuted instantiation: common.c:mp_thread_set_name Unexecuted instantiation: win_state.c:mp_thread_set_name Unexecuted instantiation: threads-posix.c:mp_thread_set_name |
232 | | |
233 | | static inline int64_t mp_thread_cpu_time_ns(mp_thread_id thread) |
234 | 0 | { |
235 | 0 | #if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(_POSIX_THREAD_CPUTIME) |
236 | 0 | clockid_t id; |
237 | 0 | struct timespec ts; |
238 | 0 | if (pthread_getcpuclockid(thread, &id) == 0 && clock_gettime(id, &ts) == 0) |
239 | 0 | return MP_TIME_S_TO_NS(ts.tv_sec) + ts.tv_nsec; |
240 | 0 | #endif |
241 | 0 | return -1; |
242 | 0 | } Unexecuted instantiation: client.c:mp_thread_cpu_time_ns Unexecuted instantiation: command.c:mp_thread_cpu_time_ns Unexecuted instantiation: configfiles.c:mp_thread_cpu_time_ns Unexecuted instantiation: external_files.c:mp_thread_cpu_time_ns Unexecuted instantiation: loadfile.c:mp_thread_cpu_time_ns Unexecuted instantiation: main.c:mp_thread_cpu_time_ns Unexecuted instantiation: misc.c:mp_thread_cpu_time_ns Unexecuted instantiation: osd.c:mp_thread_cpu_time_ns Unexecuted instantiation: playloop.c:mp_thread_cpu_time_ns Unexecuted instantiation: screenshot.c:mp_thread_cpu_time_ns Unexecuted instantiation: scripting.c:mp_thread_cpu_time_ns Unexecuted instantiation: sub.c:mp_thread_cpu_time_ns Unexecuted instantiation: video.c:mp_thread_cpu_time_ns Unexecuted instantiation: clipboard.c:mp_thread_cpu_time_ns Unexecuted instantiation: clipboard-vo.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream_cb.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream_file.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream_lavf.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream_mpv.c:mp_thread_cpu_time_ns Unexecuted instantiation: dec_sub.c:mp_thread_cpu_time_ns Unexecuted instantiation: osd_libass.c:mp_thread_cpu_time_ns Unexecuted instantiation: sd_ass.c:mp_thread_cpu_time_ns Unexecuted instantiation: sd_lavc.c:mp_thread_cpu_time_ns Unexecuted instantiation: hwdec.c:mp_thread_cpu_time_ns Unexecuted instantiation: mp_image.c:mp_thread_cpu_time_ns Unexecuted instantiation: mp_image_pool.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_gpu.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_image.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_lavc.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_libmpv.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_null.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_tct.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_kitty.c:mp_thread_cpu_time_ns Unexecuted instantiation: vo_gpu_next.c:mp_thread_cpu_time_ns Unexecuted instantiation: context.c:mp_thread_cpu_time_ns Unexecuted instantiation: timer.c:mp_thread_cpu_time_ns Unexecuted instantiation: ta.c:mp_thread_cpu_time_ns Unexecuted instantiation: ipc-unix.c:mp_thread_cpu_time_ns Unexecuted instantiation: terminal-unix.c:mp_thread_cpu_time_ns Unexecuted instantiation: filter_regex.c:mp_thread_cpu_time_ns Unexecuted instantiation: als-linux.c:mp_thread_cpu_time_ns Unexecuted instantiation: stream_dvb.c:mp_thread_cpu_time_ns Unexecuted instantiation: ra_gl.c:mp_thread_cpu_time_ns Unexecuted instantiation: utils.c:mp_thread_cpu_time_ns Unexecuted instantiation: ao_lavc.c:mp_thread_cpu_time_ns Unexecuted instantiation: buffer.c:mp_thread_cpu_time_ns Unexecuted instantiation: av_log.c:mp_thread_cpu_time_ns Unexecuted instantiation: encode_lavc.c:mp_thread_cpu_time_ns Unexecuted instantiation: msg.c:mp_thread_cpu_time_ns Unexecuted instantiation: stats.c:mp_thread_cpu_time_ns Unexecuted instantiation: demux.c:mp_thread_cpu_time_ns Unexecuted instantiation: demux_lavf.c:mp_thread_cpu_time_ns Unexecuted instantiation: demux_mkv_timeline.c:mp_thread_cpu_time_ns Unexecuted instantiation: demux_playlist.c:mp_thread_cpu_time_ns Unexecuted instantiation: packet_pool.c:mp_thread_cpu_time_ns Unexecuted instantiation: f_async_queue.c:mp_thread_cpu_time_ns Unexecuted instantiation: f_decoder_wrapper.c:mp_thread_cpu_time_ns Unexecuted instantiation: f_lavfi.c:mp_thread_cpu_time_ns Unexecuted instantiation: f_output_chain.c:mp_thread_cpu_time_ns Unexecuted instantiation: filter.c:mp_thread_cpu_time_ns Unexecuted instantiation: input.c:mp_thread_cpu_time_ns Unexecuted instantiation: dispatch.c:mp_thread_cpu_time_ns Unexecuted instantiation: rendezvous.c:mp_thread_cpu_time_ns Unexecuted instantiation: thread_pool.c:mp_thread_cpu_time_ns Unexecuted instantiation: thread_tools.c:mp_thread_cpu_time_ns Unexecuted instantiation: m_config_core.c:mp_thread_cpu_time_ns Unexecuted instantiation: m_config_frontend.c:mp_thread_cpu_time_ns Unexecuted instantiation: options.c:mp_thread_cpu_time_ns Unexecuted instantiation: audio.c:mp_thread_cpu_time_ns Unexecuted instantiation: filter_sdh.c:mp_thread_cpu_time_ns Unexecuted instantiation: lavc_conv.c:mp_thread_cpu_time_ns Unexecuted instantiation: vd_lavc.c:mp_thread_cpu_time_ns Unexecuted instantiation: vf_sub.c:mp_thread_cpu_time_ns Unexecuted instantiation: aspect.c:mp_thread_cpu_time_ns Unexecuted instantiation: dr_helper.c:mp_thread_cpu_time_ns Unexecuted instantiation: libmpv_gpu.c:mp_thread_cpu_time_ns Unexecuted instantiation: spirv.c:mp_thread_cpu_time_ns Unexecuted instantiation: video_shaders.c:mp_thread_cpu_time_ns Unexecuted instantiation: libmpv_sw.c:mp_thread_cpu_time_ns Unexecuted instantiation: path-unix.c:mp_thread_cpu_time_ns Unexecuted instantiation: formats.c:mp_thread_cpu_time_ns Unexecuted instantiation: libmpv_gl.c:mp_thread_cpu_time_ns Unexecuted instantiation: error_diffusion.c:mp_thread_cpu_time_ns Unexecuted instantiation: shader_cache.c:mp_thread_cpu_time_ns Unexecuted instantiation: user_shaders.c:mp_thread_cpu_time_ns Unexecuted instantiation: common.c:mp_thread_cpu_time_ns Unexecuted instantiation: win_state.c:mp_thread_cpu_time_ns Unexecuted instantiation: threads-posix.c:mp_thread_cpu_time_ns |