File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ func (lock *mutexInfo) wait() (int32, *list.Element) {
4848 }
4949
5050 lock .verify (holder , []* mutexInfo {lock })
51-
5251 return holder , lock .waiting .PushBack (holder )
5352}
5453
@@ -79,7 +78,6 @@ func (lock *mutexInfo) using(holder int32, elem *list.Element) {
7978 defer lockMutex .Unlock ()
8079
8180 delete (waitTargets , holder )
82-
8381 atomic .StoreInt32 (& lock .holder , holder )
8482 lock .waiting .Remove (elem )
8583}
@@ -111,3 +109,23 @@ func (m *Mutex) Unlock() {
111109 }
112110 m .Mutex .Unlock ()
113111}
112+
113+ type RWMutex struct {
114+ Mutex
115+ }
116+
117+ func (rw * RWMutex ) Lock () {
118+ rw .Lock ()
119+ }
120+
121+ func (rw * RWMutex ) Unlock () {
122+ rw .Unlock ()
123+ }
124+
125+ func (rw * RWMutex ) RLock () {
126+ rw .Lock ()
127+ }
128+
129+ func (rw * RWMutex ) RUnlock () {
130+ rw .Unlock ()
131+ }
You can’t perform that action at this time.
0 commit comments