summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-22 02:34:42 +0200
committerDudemanguy <random342@airmail.cc>2023-11-05 17:36:17 +0000
commit55ed50ba901e70adda09f1cf8c0de7cf80cabeb3 (patch)
tree2117e03f8d0046f45d21479b67d67a3ce35bca14 /input/input.c
parent174df99ffa53f1091589eaa4fa0c16cdd55a9326 (diff)
downloadmpv-55ed50ba901e70adda09f1cf8c0de7cf80cabeb3.tar.bz2
mpv-55ed50ba901e70adda09f1cf8c0de7cf80cabeb3.tar.xz
mp_thread: prefer tracking threads with id
This change essentially removes mp_thread_self() and instead add mp_thread_id to track threads and have ability to query current thread id during runtime. This will be useful for upcoming win32 implementation, where accessing thread handle is different than on pthreads. Greatly reduces complexity. Otherweis locked map of tid <-> handle is required which is completely unnecessary for all mpv use-cases. Note that this is the mp_thread_id, not to confuse with system tid. For example on threads-posix implementation it is simply pthread_t.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index b1ca1314b5..67e2249e17 100644
--- a/input/input.c
+++ b/input/input.c
@@ -1610,7 +1610,7 @@ void mp_input_src_init_done(struct mp_input_src *src)
{
assert(!src->in->init_done);
assert(src->in->thread_running);
- assert(mp_thread_equal(src->in->thread, mp_thread_self()));
+ assert(mp_thread_id_equal(mp_thread_get_id(src->in->thread), mp_thread_current_id()));
src->in->init_done = true;
mp_rendezvous(&src->in->init_done, 0);
}