NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pthread_mutexattr_setpshared ??



I am trying to build kamailo (sip) on NetBSD 8, and running into a
pthread issue.

Kamailo uses pthread_mutexattr_setpshared.  This is documented in
pthread_mutexattr(3), but at the bottom it says:

  BUGS
       The pthread_mutexattr_getpshared() and pthread_mutexattr_setpshared()
       functions are hidden by default since only thread shared attributes are
       supported.

and the kamailo code says:

 * code to set PTHREAD_PROCESS_SHARED attribute for phtread mutex to cope                                                                                                  
 * with libssl 1.1+ thread-only mutex initialization                                                                                                                       

I am really unclear on this; it seems very strange to make a mutex
thread-local since the point is to interoperate aross threads, mostly.

But, this seems to be about a mutex working in one process, vs working
in a group of proceses when in common mapped memory.

In src/lib/libpthread, it seems that mutexattr shared attributes are
always PTHREAD_PROCESS_PRIVATE, and there is code to allow setting that
and throw an error on other values.   But it's further ifdefed out.

kamailo has multiple ways to deal with mutexes, and maybe pthread isn't
the right answer on NetBSD.    Or maybe the way openssl 1.1 behaves on
NetBSD means that they are process scope, and that's ok, and the
difficulty is only about sharing  attributes somehow post fork.

Any clues appreciated -- perhaps this is just something
netbsd-{8,9,current} does not support.





Home | Main Index | Thread Index | Old Index