Re: InterlockedExchangePointer() while lock held?
- From: "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 3 Sep 2006 22:15:34 -0700
if this is access to the CancelRoutine on a PIRP, IEP() is required
regardless of the lock behing held.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
<BubbaGump> wrote in message
news:cj8nf29s8nd831iv8si58c4fkns2qcmb58@xxxxxxxxxx
Is it necessary to do interlocked exchanges while any type of lock is
held? The only reason I can think of is to ensure memory ordering,
but I got the impression that acquiring and releasing a lock already
takes care of that.
There's an InterlockedExchangePointer() in a sample in the WDM driver
book that accesses a field that looks like it's only ever accessed
while a lock is held, and I wondered if the exchange really had to be
interlocked in that case or if it was just a lazy way to avoid
declaring a temporary variable and typing 3 lines of code. I'm only
curious to understand the principle.
.
- Prev by Date: Re: [KMDF] Removing FDO and let PDO running
- Next by Date: Realted with callback interface in Windows drivers
- Previous by thread: Re: InterlockedExchangePointer() while lock held?
- Next by thread: Realted with callback interface in Windows drivers
- Index(es):
Relevant Pages
|