[vlc-devel] [PATCH 4/4] thread: make vlc_thread_self() always work

Rémi Denis-Courmont remi at remlab.net
Mon Feb 17 22:33:36 CET 2020


Le maanantaina 17. helmikuuta 2020, 22.56.09 EET Rémi Denis-Courmont a écrit :
> diff --git a/src/win32/thread.c b/src/win32/thread.c
> index e0539f9322..59d55b3925 100644
> --- a/src/win32/thread.c
> +++ b/src/win32/thread.c
> @@ -536,9 +536,9 @@ int vlc_clone_detach (vlc_thread_t *p_handle, void
> *(*entry) (void *), return vlc_clone_attr (p_handle, true, entry, data,
> priority); }
> 
> -vlc_thread_t vlc_thread_self (void)
> +unsigned long vlc_thread_self(void)
>  {
> -    return TlsGetValue(thread_key);
> +    return GetCurrentThreadId();

GetCurrentThread() seems better insofar as it returns an actual handle. But it 
also seems to be a pseudo-handle, which is presumably unsuitable for 
comparison.

>  }
> 
>  unsigned long vlc_thread_id (void)


-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list