[Mesa-dev] [PATCH 1/8] gallium/util: replace pipe_thread_get_time_nano() with u_thread_get_time_nano()
Timothy Arceri
tarceri at itsqueeze.com
Fri Mar 10 02:25:36 UTC 2017
They do the same thing we are just moving the function to be
accessible to all of Mesa.
---
src/gallium/auxiliary/os/os_thread.h | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index 468fbfe..ecd8f8a 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -251,38 +251,22 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
exit(-1);
}
}
/*
* Thread statistics.
*/
-/* Return the time of a thread's CPU time clock. */
-static inline int64_t
-pipe_thread_get_time_nano(thrd_t thread)
-{
-#if defined(PIPE_OS_LINUX) && defined(HAVE_PTHREAD)
- struct timespec ts;
- clockid_t cid;
-
- pthread_getcpuclockid(thread, &cid);
- clock_gettime(cid, &ts);
- return (int64_t)ts.tv_sec * 1000000000 + ts.tv_nsec;
-#else
- return 0;
-#endif
-}
-
/* 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 pipe_thread_get_time_nano(pthread_self());
+ return u_thread_get_time_nano(pthread_self());
#else
return 0;
#endif
}
#endif /* OS_THREAD_H_ */
--
2.9.3
More information about the mesa-dev
mailing list