mirror of
https://github.com/tmrts/go-patterns.git
synced 2025-02-16 12:33:16 +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)
|
||||
|
||||
// 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…
x
Reference in New Issue
Block a user