iOS Thread safety - Complete a block of code before thread switches
问题 I'm looking for a way to make sure that some lines of code get always executed together (before the system may switch the thread). @synchronized does not work for this as far as I know since it will only block another thread to come into this certain block. In my example I have different code parts that take influence on each other and I want to make sure that each of them blocks the other. How can this be achieved? EDIT: One Use Case could be that I'm playing back a midi file. The events go