From fc1366d62488c633d2a226d11dc87cee25c8c889 Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Wed, 19 Mar 2003 23:12:41 +0000 Subject: [PATCH] set thread WaitReason when blocking svn path=/trunk/; revision=4351 --- reactos/ntoskrnl/include/internal/ps.h | 4 ++-- reactos/ntoskrnl/ps/thread.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h index 27eb97f7794..1db9c10cdc8 100644 --- a/reactos/ntoskrnl/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -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 diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 9456e1756c0..d7070c67a93 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -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;