use a separate shim for detached threads