Thread safety test