set thread WaitReason when blocking

svn path=/trunk/; revision=4351
This commit is contained in:
Gunnar Dalsnes 2003-03-19 23:12:41 +00:00
parent 313dc5e53f
commit fc1366d624
2 changed files with 6 additions and 4 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: ps.h,v 1.43 2002/09/08 10:23:23 chorns Exp $
/* $Id: ps.h,v 1.44 2003/03/19 23:12:41 gdalsnes Exp $
*
* FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Process manager definitions
@ -474,7 +474,7 @@ VOID PsUnfreezeProcessThreads(PEPROCESS Process);
PEPROCESS PsGetNextProcess(PEPROCESS OldProcess);
VOID
PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode,
BOOLEAN DispatcherLock, KIRQL WaitIrql);
BOOLEAN DispatcherLock, KIRQL WaitIrql, UCHAR WaitReason);
VOID
PsUnblockThread(PETHREAD Thread, PNTSTATUS WaitStatus);
VOID

View file

@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.106 2002/09/08 10:23:40 chorns Exp $
/* $Id: thread.c,v 1.107 2003/03/19 23:08:46 gdalsnes Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -286,7 +286,7 @@ PsUnblockThread(PETHREAD Thread, PNTSTATUS WaitStatus)
VOID
PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode,
BOOLEAN DispatcherLock, KIRQL WaitIrql)
BOOLEAN DispatcherLock, KIRQL WaitIrql, UCHAR WaitReason)
{
KIRQL oldIrql;
PKTHREAD KThread = KeGetCurrentKPCR()->CurrentThread;
@ -324,7 +324,9 @@ PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode,
Thread->Tcb.Alertable = Alertable;
Thread->Tcb.WaitMode = WaitMode;
Thread->Tcb.WaitIrql = WaitIrql;
Thread->Tcb.WaitReason = WaitReason;
PsDispatchThreadNoLock(THREAD_STATE_BLOCKED);
if (Status != NULL)
{
*Status = Thread->Tcb.WaitStatus;