Would `volatile` help with the barrier?
Re the multi-threading issue, it should be possible to stop the profiler thread in the hook, if we keep a reference to the thread, no?
Re the multi-threading issue, it should be possible to stop the profiler thread in the hook, if we keep a reference to the thread, no?