[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH v4 00/30] NT synchronization primitive driver
From: Elizabeth Figura <zfigura () codeweavers ! com>
Date: 2024-05-15 23:32:26
Message-ID: 2322852.ElGaqSPkdT () watership
[Download RAW message or body]
On Wednesday, April 17, 2024 3:02:13 PM CDT Elizabeth Figura wrote:
> > > Except for the "unowned" semantics of zero, the actual value of the
> > > owner identifier is not interpreted by the ntsync driver at all. The
> > > intended use is to store a thread identifier; however, the ntsync
> > > driver does not actually validate that a calling thread provides
> > > consistent or unique identifiers.
> >
> > Why not verify it? Seems simple enough to put in a TID check, esp. if NT
> > mandates the same.
>
> I mostly figured it'd be simplest to leave the driver completely
> agnostic, but I don't think there's any reason we can't use the real
> TID for most calls.
While trying to implement this I did realize a reason: if a Linux thread dies
and a new Wine thread is created which happens to have the same Linux TID
*before* Wine notices the thread death, that thread's TID will be conflated
with the thread that died. I don't think we can guarantee that we notice
thread death before we notice a request to create a new Wine thread.
Using Wine-managed TIDs avoids this by virtue of ensuring that a Wine TID is
not reused until the associated Wine thread has been cleaned up.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic