[haiku-bugs] [Haiku] #15615: pthread_getcpuclockid support

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Wed, 08 Jan 2020 17:34:22 -0000

#15615: pthread_getcpuclockid support
-------------------------------+------------------------------
 Reporter:  kallisti5          |        Owner:  nobody
     Type:  bug                |       Status:  new
 Priority:  normal             |    Milestone:  Unscheduled
Component:  System/libroot.so  |      Version:  R1/Development
 Keywords:  pthread            |   Blocked By:
 Blocking:                     |  Has a Patch:  0
 Platform:  All                |
-------------------------------+------------------------------
 Seems to exist on all platforms and BSD's except Apple.

 Here's an example usage from Mesa:

 {{{
 /* Return the time of a thread's CPU time clock. */
 static inline int64_t
 u_thread_get_time_nano(thrd_t thread)
 {
 #if defined(HAVE_PTHREAD) && !defined(__APPLE__)
    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
 }
 }}}
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15615>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: