It can also happen with event driven code. Especially stuff that causes pre-emption of a line of execution, and one stack state owns a resource, it pops out, the second stack state grabs it, now there are two states holding the same resource, and either a deadlock or a race condition occurs.

Calvin