summaryrefslogtreecommitdiffstats
path: root/private/csr/server/semphore
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/csr/server/semphore
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/csr/server/semphore')
-rw-r--r--private/csr/server/semphore30
1 files changed, 30 insertions, 0 deletions
diff --git a/private/csr/server/semphore b/private/csr/server/semphore
new file mode 100644
index 000000000..df3ef3edd
--- /dev/null
+++ b/private/csr/server/semphore
@@ -0,0 +1,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.