FIDUS SYSTEMS interview question

Fix this code to eliminate a race condition