|#311570* (?/21) ⚐Flag |
<DEATH> Aaaahahahaha just had the best coding WTF moment ever
<DEATH> Better than cat-on-keyboard ones
<DEATH> Macbook suddenly started forcibly going to sleep in mid-work
<DEATH> Turns out, I was writing a debug routine with a thread sleeping + polling for a condition every 1 second, used Sleep(1000) which I *do* have declared somewhere as doing the same thing as on Windows, but forgot that the module I was doing this shit in was .m and therefore Obj-C without C++, which was calling some fucking implicitly declared C function instead of my thing, and putting the machine
<DEATH> to sleep.
<DEATH> So, if you accidentally copy Windows style Sleep(somenumber) to mac, in pure C mode rather than C++, it's going to put the machine to sleep.
<DEATH> And I thought I just broke the mac for a moment.
<DEATH> As amusing as a goatse sighting at 5 AM.