Mutexes
If this and the upcoming sections regarding the thread synchronization tools feel already familiar to you, then you'll have an easy time following the subjects that are covered, and you'll quickly learn how easy to use are the same tools implemented in Qt; otherwise, it may be a good idea to follow these sections thoroughly and carefully. So, let's start with our first thread synchronization tool. In general, if two threads try to access the same object (such as variable or class instance, and so on) at the same time, and if the order of what each thread does with the object is important, then the resulting object may sometimes be different from what we expect. Let's break it down with an example because it may still be quite confusing, ...