race condition - mmedrano9438/peripheral-brain GitHub Wiki

Race condition can occur when two or more threads are trying to get access to the same variable, at least one of them is willing to change a value of this variable and the threads don’t use any blocking. If these three conditions are met, the order of getting access to this variable becomes undefined which leads to various unexpected results. While one operation is being performed nothing else can happen, all other actions are blocked until the current one is finished.

bulb = "yellow"; syncToBlue(bulb); syncToGreen(bulb);