add multithreaded macro that unbinds when out of scope