Nexmo Interview Question

How would you make this variable thread safe?