]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/mklockrank.go
runtime: prevent send on closed channel in wakeableSleep
[gostls13.git] / src / runtime / mklockrank.go
index bc15e57dd4c9fae63a2fcc073261555121002cea..4cb232b1baf31bac7dd3bb40e48364a01c3186bb 100644 (file)
@@ -64,6 +64,7 @@ assistQueue,
 < sched;
 sched < allg, allp;
 allp < timers;
+timers < wakeableSleep;
 timers < netpollInit;
 
 # Channels
@@ -109,12 +110,14 @@ allg,
 < MALLOC
 # Below MALLOC is the malloc implementation.
 < fin,
-  gcBitsArenas,
-  mheapSpecial,
-  mspanSpecial,
   spanSetSpine,
+  mspanSpecial,
   MPROF;
 
+# We can acquire gcBitsArenas for pinner bits, and
+# it's guarded by mspanSpecial.
+MALLOC, mspanSpecial < gcBitsArenas;
+
 # Memory profiling
 MPROF < profInsert, profBlock, profMemActive;
 profMemActive < profMemFuture;
@@ -159,6 +162,11 @@ stackLarge,
 # Above mheap is anything that can call the span allocator.
 < mheap;
 # Below mheap is the span allocator implementation.
+#
+# Specials: we're allowed to allocate a special while holding
+# an mspanSpecial lock, and they're part of the malloc implementation.
+# Pinner bits might be freed by the span allocator.
+mheap, mspanSpecial < mheapSpecial;
 mheap, mheapSpecial < globalAlloc;
 
 # Execution tracer events (with a P)
@@ -179,6 +187,8 @@ NONE < panic;
 # deadlock is not acquired while holding panic, but it also needs to be
 # below all other locks.
 panic < deadlock;
+# raceFini is only held while exiting.
+panic < raceFini;
 `
 
 // cyclicRanks lists lock ranks that allow multiple locks of the same