Had to remove some pthread code that was still remaining. Also had to make
update state return an int instead of void. This way we can exit if
updateState was a failure. This is necessary because the C11 thread code
doesn't seem to have an exit thread method.