Skip to content
Prev Previous commit
Next Next commit
Update read_write_lock.md
  • Loading branch information
geolffreym authored Jun 11, 2022
commit 29f2589e130f8bc9da4f491e43a51559a510b2af
18 changes: 9 additions & 9 deletions synchronization/read_write_lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```