mirror of
https://github.com/tmrts/go-patterns.git
synced 2025-02-19 22:03:15 +03:00
Update read_write_lock.md
This commit is contained in:
parent
17e9b60552
commit
29f2589e13
@ -97,14 +97,14 @@ go func(r *Router){
|
|||||||
}(router)
|
}(router)
|
||||||
|
|
||||||
// Reading operation
|
// Reading operation
|
||||||
go func(r *Router){
|
// ...some code here
|
||||||
// ...some logic here
|
|
||||||
// reading operation 1
|
// reading operation 1
|
||||||
connection := r.Query("192.168.1.1:8080")
|
connection := r.Query("192.168.1.1:8080")
|
||||||
//... more code here
|
|
||||||
// reading operation 2
|
//... more code here
|
||||||
otherQuery:= r.Query("192.168.1.1:8081")
|
// reading operation 2
|
||||||
// read locks are like counters.. until counter = 0 Write can be acquired
|
otherQuery:= r.Query("192.168.1.1:8081")
|
||||||
}(router)
|
// read locks are like counters.. until counter = 0 Write can be acquired
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user