lkml.org 
[lkml]   [2024]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 00/30] NT synchronization primitive driver
Date
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.



\
 
 \ /
  Last update: 2024-05-27 18:29    [W:0.043 / U:29.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site