How will you write thread-safe strtok function.