Исходники и презентации
This commit is contained in:
24
lessons/sync_primitives/rw_mutex_operations/main.go
Normal file
24
lessons/sync_primitives/rw_mutex_operations/main.go
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "sync"
|
||||
|
||||
func RUnlockLockedMutex() {
|
||||
m := sync.RWMutex{}
|
||||
m.Lock()
|
||||
m.RUnlock()
|
||||
}
|
||||
|
||||
func UnlockRLockedMutex() {
|
||||
m := sync.RWMutex{}
|
||||
m.RLock()
|
||||
m.Unlock()
|
||||
}
|
||||
|
||||
func LockRLockedMutex() {
|
||||
m := sync.RWMutex{}
|
||||
m.Lock()
|
||||
m.RLock()
|
||||
}
|
||||
|
||||
func main() {
|
||||
}
|
||||
Reference in New Issue
Block a user