On Apr  8 19:37, Takashi Yano wrote:
> On Tue, 8 Apr 2025 12:23:24 +0200
> Corinna Vinschen wrote:
> > looks good, but...
> > 
> > On Apr  6 19:57, Takashi Yano wrote:
> > > @@ -1685,7 +1700,15 @@ pthread_key::~pthread_key ()
> > >     */
> > >    if (magic != 0)
> > >      {
> > > -      keys.remove (this);
> > > +      LONG64 seq = keys[key_idx].seq;
> > > +      assert (pthread_key::keys_list::ready (seq)
> > > +       && InterlockedCompareExchange64 (&keys[key_idx].seq,
> > > +                                        seq + 1, seq) == seq);
> > 
> > ...do we really want to assert here?  Shouldn't this better just skip
> > the rest of the function?
> 
> Sounds reasonable. Skipping before TlsFree (tls_index), right?

If seq is wrong, the code should just leave, I think, not touching
anything.


Corinna

Reply via email to