understandingCombine
understandingCombine copied to clipboard
Possible race condition in subjects example
Excellent book!
Just wanted to note something: the increment operation highlighted below is vulnerable to a race condition. In the example in the book, it's true that only one piece of code does the increment and it's always on the main thread, so it's safe, but the danger here should still be noted in a comment or in the text.
https://github.com/mattneub/understandingCombine/blob/236c4af76689d71d985cd00bf64a1b726101ca35/publishers/publishersSubject.txt#L24