Another thing worth checking is that it only gets triggered once, per thread, to avoid the pragmas from being executed multiple times unnecessarily.