In programming, particularly in Java, what does an InterruptedException typically indicate?
A) The code has encountered a syntax error
B) A thread has been interrupted while it is waiting, sleeping, or otherwise occupied
C) There is a logical error in the code execution
D) The application has run out of memory