Makes Window methods thread-safe.