|
Message-ID: <20151016031537.GD8645@brightrain.aerifal.cx> Date: Thu, 15 Oct 2015 23:15:37 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH v2 2/2] pthread: implement try/timed join variants On Sun, Oct 11, 2015 at 10:30:20PM -0400, Rich Felker wrote: > > +int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec *at) > > +{ > > + int tmp, cs, r = 0; > > + __pthread_testcancel(); > > + __pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); > > + if (cs == PTHREAD_CANCEL_ENABLE) __pthread_setcancelstate(cs, 0); > > + while ((tmp = t->tid) && r != ETIMEDOUT && r != EINVAL) > > + r = __timedwait_cp(&t->tid, tmp, CLOCK_REALTIME, at, 0); > > + __pthread_setcancelstate(cs, 0); > > + if (r == ETIMEDOUT || r == EINVAL) return r; > > + return __pthread_tryjoin_np(t, res); > > +} > > + > > +int __pthread_join(pthread_t t, void **res) > > +{ > > + return __pthread_timedjoin_np(t, res, 0); > > +} > > + > > +weak_alias(__pthread_tryjoin_np, pthread_tryjoin_np); > > +weak_alias(__pthread_timedjoin_np, pthread_timedjoin_np); > > weak_alias(__pthread_join, pthread_join); > > This all looks okay to me. I'll probably commit the patch as-is, as > long as nobody thinks the reasoning on the tryjoin issue above is > wrong. I went ahead and committed patch 1 since it's an obvious bug fix. The second patch still looks ok to me but I'm going to hold off until after release because I don't want to rush addition of a new nonstandard extension without good review. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.