blob: df3ef3edd3830d9776fdf6b19ad52e8aacee8e69 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
To prevent deadlock, semaphores must be taken in the following
order:
ProcessStructureLock
ProcessLock
ThreadLock
CurrentConsoleLock
ConsoleHandleTableLock
ConsoleLock
ReadCountLock (console)
WaitListsLock
ProcessStructureLock -
must be held to change process or thread structure.
held while traversing process/thread tree. always must be held
when calling CsrLocateThreadByClientId.
ProcessLock -
must be held exclusively to destroy a process
can be held shared or exclusive.
held shared for during of an api call so that process isn't destroyed
by another process during call.
held exclusively means that no one else can access contents
ThreadLock -
must be held exclusively to destroy a thread
can be held shared or exclusive.
held shared for during of an api call so that thread isn't destroyed
by another thread during call.
|