Mechanism that allow us to prevent concurrent processes from entering a critical section or that's already been executed by another process.
馃摌 Imagine we have Gopher with a bank balance of a $1000 to start. then Gopher tries to add $ 500 to this account Now one go routine would see this transaction, read the value of a $1000 and proceed to try and add $500 to that account. That balance however at the exact same moment a charge of $700 as applied to pay his mortgage (hipoteca) and the second proccess reads the inital value of the $700 before the first is able to add the additional deposit of $500 and it then proceeds to substract $700 from a $1000. Now the customer then checks his bank balance the next day, and notices that he is down $300. As the second process was unaware of the first deposit and overrruled the value upon completion of that second goroutine. So now that we know what the problem is let'see how we can fix it using a mutex
馃摌 Tenemos a Gopher que tiene en su cuenta, un balance de $1000. Quiere depositar $500, entonces una rutina va a leer el balance inicial y hacer el dep贸sito de dicho monto. Sin embargo, al mismo tiempo, se le aplica una extracci贸n de $700 para pagar su hipoteca. Este segundo proceso, lo que hace es leer su dep贸sito inicial $1000 y retirar los $700 respectivos. Al otro d铆a, Gopher chequea su cuenta y nota que tiene un balance de solamente $300 a favor.
Con Mutex, podemos solucionar este problema.