Skip to content

Conversation

@lakshanwd
Copy link

I was unable to manage cache concurrently as mentioned in examples/concurrent-cache-manager/concurrent-cache-manager.go

This PR fixes issue #43

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 096fe9c on lakshanwd:master into a100c5a on muesli:master.


// Foreach all items
func (table *CacheTable) Foreach(trans func(key interface{}, item *CacheItem)) {
table.RLock()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed as a call to store.Delete in the scope of store.Foreach waits for the release of ReadLock and so it causes a deadlock #43

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this lock will prevent a dead-lock, but it will break concurrency safety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants