Inlined threading functions