lkml.org 
[lkml]   [2016]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 7/7] [PATCH] glibc: nptl: Add support for attached pthread_mutexes
On Sat, 2 Apr 2016, Peter Zijlstra wrote:
> On Sat, Apr 02, 2016 at 11:09:20AM -0000, Thomas Gleixner wrote:
> > To undo the attachment each involved thread needs to call
> >
> > pthread_mutex_detach_np(&mutex);
> >
> > When the last user detaches the kernel state is destroyed.
>
> So I was fully expecting pthread_mutex_{at,de}tach_np() to not exist and
> be internal to pthread_mutex_{init,destroy}().
>
> Is there a reason this is not so?

init/destroy are only called once and not on all threads using the futex. If
you want to hide that, then you need to add it to all pthread_mutex_*
operations and attach on the first call.

That's possible, but for simplicity we made it explicit.

Thanks,

tglx

\
 
 \ /
  Last update: 2016-04-03 12:21    [W:0.274 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site