mirror of
https://github.com/tmrts/go-patterns.git
synced 2025-04-02 20:56:12 +03:00
Update read_write_lock.md
This commit is contained in:
parent
17e9b60552
commit
29f2589e13
1 changed files with 9 additions and 9 deletions
|
@ -97,14 +97,14 @@ go func(r *Router){
|
|||
}(router)
|
||||
|
||||
// Reading operation
|
||||
go func(r *Router){
|
||||
// ...some logic here
|
||||
// reading operation 1
|
||||
connection := r.Query("192.168.1.1:8080")
|
||||
//... more code here
|
||||
// reading operation 2
|
||||
otherQuery:= r.Query("192.168.1.1:8081")
|
||||
// read locks are like counters.. until counter = 0 Write can be acquired
|
||||
}(router)
|
||||
// ...some code here
|
||||
|
||||
// reading operation 1
|
||||
connection := r.Query("192.168.1.1:8080")
|
||||
|
||||
//... more code here
|
||||
// reading operation 2
|
||||
otherQuery:= r.Query("192.168.1.1:8081")
|
||||
// read locks are like counters.. until counter = 0 Write can be acquired
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue