[vlc-commits] win32: inline vlc_thread_self() internally

Rémi Denis-Courmont git at videolan.org
Tue Feb 18 18:58:24 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Feb 17 22:20:44 2020 +0200| [325363f6c67c14cc80d9032fe359fd4e0a4a0573] | committer: Rémi Denis-Courmont

win32: inline vlc_thread_self() internally

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=325363f6c67c14cc80d9032fe359fd4e0a4a0573
---

 src/win32/thread.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index 4d6d7bdb5d..42e8232333 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -545,7 +545,7 @@ void vlc_cancel (vlc_thread_t th)
 
 int vlc_savecancel (void)
 {
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     if (th == NULL)
         return false; /* Main thread - cannot be cancelled anyway */
 
@@ -556,7 +556,7 @@ int vlc_savecancel (void)
 
 void vlc_restorecancel (int state)
 {
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     assert (state == false || state == true);
 
     if (th == NULL)
@@ -568,7 +568,7 @@ void vlc_restorecancel (int state)
 
 void vlc_testcancel (void)
 {
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
     if (!th->killable)
@@ -592,7 +592,7 @@ void vlc_control_cancel (vlc_cleanup_t *cleaner)
     /* NOTE: This function only modifies thread-specific data, so there is no
      * need to lock anything. */
 
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
 
@@ -611,7 +611,7 @@ void vlc_control_cancel (vlc_cleanup_t *cleaner)
 
 void vlc_cancel_addr_set(atomic_uint *addr)
 {
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
 
@@ -623,7 +623,7 @@ void vlc_cancel_addr_set(atomic_uint *addr)
 
 void vlc_cancel_addr_clear(atomic_uint *addr)
 {
-    struct vlc_thread *th = vlc_thread_self();
+    struct vlc_thread *th = TlsGetValue(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
 



More information about the vlc-commits mailing list