1
0
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:
Geolffrey Mena 2022-06-10 20:57:23 -06:00 committed by GitHub
parent 17e9b60552
commit 29f2589e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
```