Kevin Atkinson wrote:
[...]
> > > > your Mutex class offers undefined behavior;
> > > > you really can NOT "replicate" a {pthread_mutex_t} mutex.
> > >
> > > Where do I replicate a mutex?
> >
> > "....
> >  static const pthread_mutex_t MUTEX_INIT = PTHREAD_MUTEX_INITIALIZER;
> >
> >  class Mutex {
> >    pthread_mutex_t l_;
> >  public:
> >    Mutex() : l_(MUTEX_INIT) {}"
> >              ^^^^^^^^^^^^^^
> 
> I believe this behavior is well defined.  ....

http://www.opengroup.org/onlinepubs/007904975/functions/pthread_mutex_init.html

"....
 Only /mutex/ itself may be used for performing synchronization. 
 The result of referring to copies of /mutex/ in calls to <snip>
 is undefined."

End of story.

regards,
alexander.

--
http://groups.google.com/groups?threadm=7601581c.0210101239.5844c0f1%40posting.google.com
(Subject: PTHREAD_STATIC_INITIALIZER, class constructor)

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to