Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add locking around dictionary as computed property #3

Closed
wants to merge 1 commit into from

Conversation

djones6
Copy link
Contributor

@djones6 djones6 commented Jun 26, 2019

KafkaProducer.kafkaHandleToMessageCallback is a dictionary that is accessed by multiple threads. The code in KafkaProducer used a semaphore to prevent concurrent access, but this was missed in accesses outside of that class (such as in KafkaConfig.setDeliveredMessageCallback()).

This replaces the semaphore with a computed property and NSLock approach similar to Kitura/LoggerAPI#47 .

@djones6
Copy link
Contributor Author

djones6 commented Jun 27, 2019

As discussed, closing as the (now fixed) semaphore approach is much faster.

@djones6 djones6 closed this Jun 27, 2019
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.

None yet

1 participant