Forgot to init mutex and condition.
If loop should be a while loop, so it can keep checking everytime it's signaled.