Use interlocked functions for thread safety.

1 file changed