1. A method comprising: determining a state of a variable corresponding to a semaphore; generating a semaphore entry for a thread of instructions prior to dispatch of the thread for execution if the variable is in a first state; and dispatching the thread of instructions for execution prior to generating the semaphore entry for the thread if the variable is in a second state.