diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-22 02:34:42 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-05 17:36:17 +0000 |
commit | 55ed50ba901e70adda09f1cf8c0de7cf80cabeb3 (patch) | |
tree | 2117e03f8d0046f45d21479b67d67a3ce35bca14 /common/stats.h | |
parent | 174df99ffa53f1091589eaa4fa0c16cdd55a9326 (diff) | |
download | mpv-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 'common/stats.h')
-rw-r--r-- | common/stats.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/stats.h b/common/stats.h index 03b16769f0..c3e136e5b3 100644 --- a/common/stats.h +++ b/common/stats.h @@ -30,5 +30,5 @@ void stats_event(struct stats_ctx *ctx, const char *name); // or stats_unregister_thread() is called, otherwise UB will occur. void stats_register_thread_cputime(struct stats_ctx *ctx, const char *name); -// Remove reference to mp_thread_self(). +// Remove reference to the current thread. void stats_unregister_thread(struct stats_ctx *ctx, const char *name); |