Translated __has_pending()

I had to use some breaks to avoid go-to that, hopefully, work. I did not translated the previous function, __deadlock(), because I was not sure what the keyword register means and couldn't understand the function's signature. Please review my code and, as usually, feel free to modify it.