mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
Added InterlockedCompareExchangePointer macro and 64 bit versions for Interlocked[Compare]ExchangePointer macros for use in ntoskrnl.
svn path=/trunk/; revision=11915
This commit is contained in:
parent
666228254c
commit
7acc56f32e
2 changed files with 20 additions and 10 deletions
|
@ -991,8 +991,23 @@ InterlockedIncrement (
|
|||
);
|
||||
|
||||
#ifndef InterlockedExchangePointer
|
||||
#define InterlockedExchangePointer(__T__, __V__) \
|
||||
(PVOID)InterlockedExchange((PLONG)(__T__), (LONG)(__V__))
|
||||
# ifdef _WIN64
|
||||
# define InterlockedExchangePointer(__T__, __V__) \
|
||||
(PVOID)InterlockedExchange64((PLONGLONG)(__T__), (LONGLONG)(__V__))
|
||||
# else
|
||||
# define InterlockedExchangePointer(__T__, __V__) \
|
||||
(PVOID)InterlockedExchange((PLONG)(__T__), (LONG)(__V__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef InterlockedCompareExchangePointer
|
||||
# ifdef _WIN64
|
||||
# define InterlockedCompareExchangePointer(__T__, __V__, __C__) \
|
||||
(PVOID)InterlockedCompareExchange64((PLONGLONG)(__T__), (LONGLONG)(__V__), (LONGLONG)(__C__))
|
||||
# else
|
||||
# define InterlockedCompareExchangePointer(__T__, __V__, __C__) \
|
||||
(PVOID)InterlockedCompareExchange((PLONG)(__T__), (LONG)(__V__), (LONG)(__C__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*---*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: kill.c,v 1.88 2004/12/04 15:49:20 blight Exp $
|
||||
/* $Id: kill.c,v 1.89 2004/12/04 16:56:20 blight Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -142,13 +142,8 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
|||
/* If the ProcessoR Control Block's NpxThread points to the current thread
|
||||
* unset it.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
InterlockedCompareExchange64((LONGLONG *)&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
||||
(LONGLONG)NULL, (LONGLONG)ETHREAD_TO_KTHREAD(CurrentThread));
|
||||
#else
|
||||
InterlockedCompareExchange((LONG *)&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
||||
(LONG)NULL, (LONG)ETHREAD_TO_KTHREAD(CurrentThread));
|
||||
#endif
|
||||
InterlockedCompareExchangePointer(&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
||||
NULL, ETHREAD_TO_KTHREAD(CurrentThread));
|
||||
|
||||
KeReleaseSpinLock(&PiThreadLock, oldIrql);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue