Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 174 forks source link

Make stubbed calls more thread safe #392

Closed ChaosCoder closed 3 years ago

ChaosCoder commented 3 years ago

This PR adds thread safety around memorizing stub calls inside the MockManager.

Calling stubbed methods from a multithreading environment lead to crashing. By using a private queue for synchronizing write access to the appropriate collections calling stubs multithreaded is no longer a problem.

Resolves #298 and supersedes #351.

MatyasKriz commented 3 years ago

Thanks for the PR, @ChaosCoder! It looks good, although it can be a bit better. 🙂

MatyasKriz commented 3 years ago

Thanks for resolving the issues so quickly! Looks great and I will try to merge this as soon as I can. 🙂

MatyasKriz commented 3 years ago

Thanks again for the PR! I've merged it and will release it shortly.

ChaosCoder commented 3 years ago

So, just to make sure this does not get lost: this PR is still not merged. ;)

MatyasKriz commented 3 years ago

Hey, actually it is. It's been rebased, so GitHub didn't notice. Thanks for reminding me to close the PR. 🙂