This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fwd: threads.h implementation issues
- From: Juan Manuel Torres Palma <j dot m dot torrespalma at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 29 Oct 2014 08:24:46 +0100
- Subject: Fwd: threads.h implementation issues
- Authentication-results: sourceware.org; auth=none
- References: <CAD82F-r6+-rDWuKycWkAX1e_U0rFRh2CkURaigwqMTynSt7yaw at mail dot gmail dot com> <20141027221931 dot GN22465 at brightrain dot aerifal dot cx> <CAD82F-ro-Df6zHei_vR7_0szbGsm690p2xC+RTK=KVQ=+294Lg at mail dot gmail dot com>
> 3. Cast int->uintptr_t->void*->uintptr_t->int to round-trip the int
> result via a value of type void*. This assumes that any value of
> int can be represented in uintptr_t, and that any value of
> uintptr_t can be represented in void*. I think this is acceptable
> but others may disagree.
That worked amazingly good, thanks.
> That should be fine, but you need to keep nanosleep out of the
> namespace, so either use __nanosleep (if it exists) or an inline
> syscall.
I thought that nanosleep is part of <time.h> that is automatically
included with threads.h, so there must be no namespace problems. If
there is, please let me know why.
One more question. I made a function named __thrd_err_map, that I use
to match errors between those received by pthread_* functions and is
only used in the definition file (.c), so I'm also including
<errno.h>. Any inconvenience on that?
Thanks for the feedback.
Cheers.
--
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.
--
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.