This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AW: Specific Linux syscalls for glibc API


On 18/11/15 16:07, Szabolcs Nagy wrote:
On 18/11/15 12:57, Warlich, Christof wrote:
On 11/17/2015 05:34 PM, Joseph Myers wrote
* gettid, pthread_gettid_np (bug 6399).

I'm not sure w.r.t. the added value of a gettid wrapper though: Assuming the
availability of pthread_gettid_np(), pthread_gettid_np(pthread_self()) would
(apart from some locking to prevent thread termination in the meantime) just
do what gettid() is supposed to do.


i don't see why would you lock there.
(this api should be as-safe)

pthread_gettid_np is problematic api because of the
issue Florian raised (tid is lost after a thread
exited but not yet joined and that should not be
visible to the caller, so this api is only possible
to implement if tid handling is redesigned).


ignore this

tid is not useful after the thread exited,
so using a tid has to be synched with thread
exit, so the user of the tid must know about
the thread exit event, pthread_gettid_np does
not expose anything it shouldn't.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]