mirror of
https://github.com/tmrts/go-patterns.git
synced 2024-11-21 20:46:08 +03:00
Update read_write_lock.md
This commit is contained in:
parent
29f2589e13
commit
36b07a4765
@ -100,11 +100,11 @@ go func(r *Router){
|
||||
// ...some code here
|
||||
|
||||
// reading operation 1
|
||||
connection := r.Query("192.168.1.1:8080")
|
||||
connection := router.Query("192.168.1.1:8080")
|
||||
|
||||
//... more code here
|
||||
// reading operation 2
|
||||
otherQuery:= r.Query("192.168.1.1:8081")
|
||||
otherQuery:= router.Query("192.168.1.1:8081")
|
||||
// read locks are like counters.. until counter = 0 Write can be acquired
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user