muesli / cache2go

Concurrency-safe Go caching library with expiration capabilities and access counters
Other
2.11k stars 518 forks source link

improve NotFoundAdd method on cachetable.go #46

Closed KZHIWEI closed 4 years ago

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 0fb3fef3c32eee4c10b2c9fd0d34b39a6ecf88d0 on KZHIWEI:hotfix/improve_NotFoundAdd into a100c5aac93f7a7d098476b35764cb1c6286df8d on muesli:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 0fb3fef3c32eee4c10b2c9fd0d34b39a6ecf88d0 on KZHIWEI:hotfix/improve_NotFoundAdd into a100c5aac93f7a7d098476b35764cb1c6286df8d on muesli:master.

muesli commented 4 years ago

For posterity: this would be dangerous, because between unlocking the read-lock and acquiring the write-lock, the state of the table could have changed again.