aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-09 10:03:00 +1100
committerTimothy Arceri <[email protected]>2017-03-12 17:49:04 +1100
commit14e6b8695206dc2b3f38c65ae5fab0e1819e2725 (patch)
tree6757a3631f78ddcaaedc476cf20d902d06697b0a
parentf8cc4c25b8985e7f834510ca9d34eec308f413e3 (diff)
gallium/util: replace pipe_thread_get_time_nano() with u_thread_get_time_nano()
They do the same thing we just moved the function to be accessible to all of Mesa. Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/auxiliary/os/os_thread.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index 468fbfe2f92..ecd8f8a5e97 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -258,28 +258,12 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
* 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