From 04a676f3c8d2443499f27612f69ee88e12089e61 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 22 Apr 2018 18:59:13 +0100 Subject: linuxthreads: implement pthread_condattr_{s,g}etclock() More applications are using pthread_condattr_setclock()/ pthread_condattr_getclock() in their code. Port these two functions from NPTL over to be more compatible. --- libpthread/linuxthreads/internals.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libpthread/linuxthreads/internals.h') diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h index ab6b01528..720be8ec0 100644 --- a/libpthread/linuxthreads/internals.h +++ b/libpthread/linuxthreads/internals.h @@ -51,6 +51,25 @@ # define THREAD_SETMEM_NC(descr, member, value) descr->member = (value) #endif +/* Conditional variable attribute data structure. */ +struct pthread_condattr +{ + /* Combination of values: + + Bit 0 : flag whether coditional variable will be shareable between + processes. + + Bit 1-7: clock ID. */ + int value; +}; + +/* The __NWAITERS field is used as a counter and to house the number + of bits for other purposes. COND_CLOCK_BITS is the number + of bits needed to represent the ID of the clock. COND_NWAITERS_SHIFT + is the number of bits reserved for other purposes like the clock. */ +#define COND_CLOCK_BITS 1 +#define COND_NWAITERS_SHIFT 1 + /* Arguments passed to thread creation routine */ struct pthread_start_args { -- cgit v1.2.3