OverWatch 2 quickly overheats my Ryzen 9 CPU

My system suddenly halts while I’m waiting to login to OverWatch 2. Yes, I’ve tried setting default BIOS settings, I’ve disabled core performance boost in the BIOS, I’ve tried under clocking, I’m using max fan speeds, nothing helps. The same thing happens every time. Shortly after starting OW2, my system suddenly halts.

I have a Ryzen 9 5900x CPU, 32 gb of ram, an RTX 3060, and I’m running on Windows 10. I have a Rog Strix e-gaming motherboard, I’ve updated the bios. I have all the latest drivers.

This problem doesn’t occur with any other game I play, with ONE VERY NOTABLE EXCEPTION - I can make this happen in a game I’m coding myself with C++ and OpenGL/GLFW/glad: If I set the glfwSwapInterval to 0 and I don’t use any frame update sleep, this same exact problem will happen. Shortly after starting my game, my CPU overheats and my system halts. I can prevent this by setting glfwSwapInterval to 1 in my game code. If I do that, I get good frame rates, smooth operation, and my CPU doesn’t overheat at all.