[vlc-commits] os2: inline vlc_thread_self() locally

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


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

os2: inline vlc_thread_self() locally

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

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

diff --git a/src/os2/thread.c b/src/os2/thread.c
index 7975cd52a7..f2eb435129 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -79,7 +79,7 @@ static ULONG vlc_DosWaitEventSemEx( HEV hev, ULONG ulTimeout )
     int       n;
     ULONG     rc;
 
-    struct vlc_thread *th = vlc_thread_self ();
+    struct vlc_thread *th = vlc_threadvar_get(thread_key);
     if( th == NULL || !th->killable )
     {
         /* Main thread - cannot be cancelled anyway
@@ -705,7 +705,7 @@ int vlc_savecancel (void)
 {
     int state;
 
-    struct vlc_thread *th = vlc_thread_self ();
+    struct vlc_thread *th = vlc_threadvar_get(thread_key);
     if (th == NULL)
         return false; /* Main thread - cannot be cancelled anyway */
 
@@ -716,7 +716,7 @@ int vlc_savecancel (void)
 
 void vlc_restorecancel (int state)
 {
-    struct vlc_thread *th = vlc_thread_self ();
+    struct vlc_thread *th = vlc_threadvar_get(thread_key);
     assert (state == false || state == true);
 
     if (th == NULL)
@@ -728,7 +728,7 @@ void vlc_restorecancel (int state)
 
 void vlc_testcancel (void)
 {
-    struct vlc_thread *th = vlc_thread_self ();
+    struct vlc_thread *th = vlc_threadvar_get(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
 
@@ -754,7 +754,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 = vlc_threadvar_get(thread_key);
     if (th == NULL)
         return; /* Main thread - cannot be cancelled anyway */
 
@@ -774,7 +774,7 @@ void vlc_control_cancel (vlc_cleanup_t *cleaner)
 static int vlc_select( int nfds, fd_set *rdset, fd_set *wrset, fd_set *exset,
                        struct timeval *timeout )
 {
-    struct vlc_thread *th = vlc_thread_self( );
+    struct vlc_thread *th = vlc_threadvar_get(thread_key);
 
     int rc;
 



More information about the vlc-commits mailing list