Am Samstag, den 30.08.2014, 22:44 -0400 schrieb Rich Felker: > On Sat, Aug 30, 2014 at 09:31:11PM -0400, Rich Felker wrote: > > On Sat, Aug 30, 2014 at 08:30:34PM -0400, Rich Felker wrote: > > > > For the C thread TU, what would be the mechanics for them to call one > > > > of the (aliased) pthread functions? > > > > > > With my alternate solution just described, simply including the normal > > > pthread header and casting the pointer when making the call would be > > > fully legal. > > > > > > With the approach we previously discussed, where we have to ensure > > > that no TU that accesses the contents of a mutex or cv structure can > > > see both the C11 and POSIX versions, The C11 TUs would have to contain > > > prototypes for the aliased POSIX functions like: > > > > > > int __pthread_mutex_lock(mtx_t *); > > > > > > Note that this is a perfectly correct prototype because mtx_t is just > > > this TU's typedef name for the tagless "struct { union { ... } __u; }" > > > that it's using, which is "the same type" as pthread_mutex_lock.c's > > > pthread_mutex_t. > > > > Actually, unless the C11 functions actually access the mutex object, > > their implementation files don't need to avoid having both types > > visible. Only the TUs that dereference the object (i.e. the pthread > > ones) need to ensure that only one version of the type is visible. > > The more I think about it, the more I think the visibility of the > other type is utterly irrelevant. Yes, inside the C thread implementation it is. So as you have seen I already came to the same conclusion, and so I applied that idea to the latest series of patches. I think this discussion is settled, then. Jens -- :: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::