fold threadsafety into context