projects
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed a few race conditions during thread/process termination leading to dead-locks
[reactos.git]
/
reactos
/
ntoskrnl
/
ps
/
create.c
diff --git
a/reactos/ntoskrnl/ps/create.c
b/reactos/ntoskrnl/ps/create.c
index
b0b7d24
..
0aa5a92
100644
(file)
--- a/
reactos/ntoskrnl/ps/create.c
+++ b/
reactos/ntoskrnl/ps/create.c
@@
-166,7
+166,7
@@
PsCreateTeb(HANDLE ProcessHandle,
else
{
Process = Thread->ThreadsProcess;
else
{
Process = Thread->ThreadsProcess;
-
ExAcquireFastMutex(&Process->TebLock
);
+
PsLockProcess(Process, FALSE
);
if (NULL == Process->TebBlock ||
Process->TebBlock == Process->TebLastAllocated)
{
if (NULL == Process->TebBlock ||
Process->TebBlock == Process->TebLastAllocated)
{
@@
-180,7
+180,7
@@
PsCreateTeb(HANDLE ProcessHandle,
PAGE_READWRITE);
if (! NT_SUCCESS(Status))
{
PAGE_READWRITE);
if (! NT_SUCCESS(Status))
{
-
ExReleaseFastMutex(&Process->TebLock
);
+
PsUnlockProcess(Process
);
DPRINT1("Failed to reserve virtual memory for TEB\n");
return Status;
}
DPRINT1("Failed to reserve virtual memory for TEB\n");
return Status;
}
@@
-199,7
+199,7
@@
PsCreateTeb(HANDLE ProcessHandle,
return Status;
}
Process->TebLastAllocated = TebBase;
return Status;
}
Process->TebLastAllocated = TebBase;
-
ExReleaseFastMutex(&Process->TebLock
);
+
PsUnlockProcess(Process
);
}
DPRINT ("TebBase %p TebSize %lu\n", TebBase, TebSize);
}
DPRINT ("TebBase %p TebSize %lu\n", TebBase, TebSize);