Re-add threadsafety. On non-Java platforms, all method calls are wrapped at the top level