This may not be the answer, but more explanation.
If two threads were allowed to access the same pixel at the same time - something that would be due to the presence of a multi-threaded user interface - you will need some kind of synchronization between the threads. If the threads are not synchronized, how to determine the color of the pixel?
Thus, we will need to add a lock. Pixel locking is very expensive, so we will soon move on to locking for each control or for each window. There you go: allowing 1 and only 1 thread to access the user interface, we implemented a lock.
BTW: replace the pixel with control or controltree; it's not just about pixels about shared data, be it a pixel or a control.
source share