[Mesa-dev] [PATCH 4/8] gallium/os_thread: simplify helper pipe_current_thread_get_time_nano

Marek Olšák maraeo at gmail.com
Thu Sep 6 04:02:25 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/auxiliary/os/os_thread.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index f2629c5ffe5..322888b825f 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -158,18 +158,14 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
 
 
 /*
  * Thread statistics.
  */
 
 /* Return the time of the current thread's CPU time clock. */
 static inline int64_t
 pipe_current_thread_get_time_nano(void)
 {
-#if defined(HAVE_PTHREAD)
-   return u_thread_get_time_nano(pthread_self());
-#else
-   return 0;
-#endif
+   return u_thread_get_time_nano(thrd_current());
 }
 
 #endif /* OS_THREAD_H_ */
-- 
2.17.1



More information about the mesa-dev mailing list