Patent ID: 6910213

Claim:
A program control apparatus for controlling execution of a program in a computer system in which a plurality of threads are switched in accordance with a scheduling policy by a scheduler, comprising: a first means for setting a prescribed flag to a first state, wherein said first means for setting a prescribed flag is responsive to a first application program interface call for requesting a start of context switching detection made from a first thread of said plurality of threads; a second means for setting the prescribed flag to a second state, wherein said second means for setting the prescribed flag is responsive to context switches and sets the prescribed flag to the second state when a context switch is detected while the prescribed flag is in the first state; a means for producing a first return value when the prescribed flag is in the first state and for producing a second return value when the prescribed is in the second state, wherein said means for producing a return value is responsive and passes said return value to, said first thread making a second application program interface call requesting a termination of context switch detection; and a means for invalidating said first thread if the return value is set to said second value when said first thread calls said second application program interface.