You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but this check-then-add pattern is not threadsafe. Instead, we should use an unconditional Add that returns true if the item was not previously in the cache. Then the usage would be:
ifcache.Add(ip) {
Trace(ip)
}
which (as long as Add is mutex-protected) is threadsafe.
The text was updated successfully, but these errors were encountered:
Ya, I assigned this one to you because you will be moving the location of the cache around already, so it seems like a small bug to fix as part of that work.
It is designed to be used like:
but this check-then-add pattern is not threadsafe. Instead, we should use an unconditional
Add
that returns true if the item was not previously in the cache. Then the usage would be:which (as long as
Add
is mutex-protected) is threadsafe.The text was updated successfully, but these errors were encountered: