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

View File

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