Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

IOptionsMonitor is singleton but listener registration is not thread safe #204

Closed
pakrym opened this issue Jun 20, 2017 · 5 comments
Closed
Assignees
Milestone

Comments

@pakrym
Copy link
Contributor

pakrym commented Jun 20, 2017

Bad things might happen if two consumers subscribe concurrently.
Also if subscription happens during invocation.
/cc @HaoK

@HaoK
Copy link
Member

HaoK commented Jun 20, 2017

Yuck, yup not threadsafe

@HaoK
Copy link
Member

HaoK commented Jun 26, 2017

Discussed with @ajcvickers will fix with either using a SynchronizedCollection or explicit locks

@HaoK HaoK self-assigned this Jun 26, 2017
@HaoK HaoK added this to the 2.0.0 milestone Jun 26, 2017
@pakrym
Copy link
Contributor Author

pakrym commented Jun 26, 2017

You can also use event internally it is already synchronized.

@HaoK
Copy link
Member

HaoK commented Jun 26, 2017

Good idea, this is pretty much the exact usage pattern for events...

@HaoK
Copy link
Member

HaoK commented Jun 27, 2017

ff42006

@HaoK HaoK closed this as completed Jun 27, 2017
@HaoK HaoK added 3 - Done and removed 2 - Working labels Jun 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants