aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rwmutex.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/rwmutex.go')
-rw-r--r--src/runtime/rwmutex.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runtime/rwmutex.go b/src/runtime/rwmutex.go
index 5833d59576..4f9585f98d 100644
--- a/src/runtime/rwmutex.go
+++ b/src/runtime/rwmutex.go
@@ -72,9 +72,7 @@ func (rw *rwmutex) rlock() {
// things blocking on the lock may consume all of the Ps and
// deadlock (issue #20903). Alternatively, we could drop the P
// while sleeping.
- acquirem()
-
- acquireLockRank(rw.readRank)
+ acquireLockRankAndM(rw.readRank)
lockWithRankMayAcquire(&rw.rLock, getLockRank(&rw.rLock))
if rw.readerCount.Add(1) < 0 {
@@ -116,8 +114,7 @@ func (rw *rwmutex) runlock() {
unlock(&rw.rLock)
}
}
- releaseLockRank(rw.readRank)
- releasem(getg().m)
+ releaseLockRankAndM(rw.readRank)
}
// lock locks rw for writing.