Threading support in stub_tx