UPP3 SVAR

We have a 'hold and wait' issue that is likely to arise in uppg3a. When this issue occurs the scenario, is
that one thread is holding on to a resource but it is waiting to get this other resource. However, the other resource is being
held by another thread that is waiting for the resource that was initally locked by the first thread. Ex, thread 1 locks m1 mutex but is
trying to get a hold of m2 but cannot because m2 is already locked by thread 2 which in turn is disallowed access to resource within m1
mutex by thread 1. The resources aren't sharable by threads and the program will likely result in a deadlock and thus
unable to fluctuate between values 1 and 2, the program will consistently print zeroes (in most cases).

Upp3b program on the other hand is implementing deadlock prevention by using trylocks. When implementing trylocks;
an attempt at accessing a mutex object that has already been locked by another thread will return the call, which provides
space for retreating and unlocking mutex locks in favor of other threads who might want access.
This makes the system call, ideal to use in an 'if' statement, because the threads are protected from rendering the mutex resources
unsharable and from the 'hold and wait' circumstance. As an example, t1 activates the m1 mutex, but it later wants to get to the
resource inside m2. But m2 is locked by thread 2, and only thread 2 can unlock it. The if statement in thread 1's function will
notice that it will simply retreat and unlock the m1 lock which thread 2 wants access to. This way there is synchronisation
with the threads but they are cooperating as to avoid deadlock.
