1. A computer system for preventing a delay in execution time of one or more instructions in one or more threads executed by exclusively using an external resource, the computer system comprising: a lock unit adapted to execute an instruction, wherein the instruction is at least one selected from a set comprising an instruction to acquire exclusive-use of the external resource and an instruction to release the exclusive-use of the external resource; a counter unit adapted to performing at least one of increasing or decreasing, in accordance with the execution of at least one instruction of the lock unit, a value of a counter associated with the at least one thread; and a controller adapted to control, in accordance with at least one selected from the value of the counter and a change in the value of the counter, an execution order of the instructions and instructions that cause a delay in the execution time, wherein a computer program execution environment includes the external resource.