This is waiting with interrupts disabled.  That won't give any other thread or interrupt any chance to give the semaphore if it was initially contended.