摘要 |
An instruction capable of preventing incorrect usage of ucontext functions in a multi-process environment is disclosed. During an execution of a setcontext instruction, a determination is made whether or not a contextID of a context structure associated with a next context indicates that it is an original context of a process. If the contextID of the next context structure is an original context of a process, another determination is made whether or not the contextID of the context structure associated with the next context is the same as the original contextID of the process. If the contextID of the context structure associated with the next context is not the same as the original contextID of the process, an error recovery routine is invoked.
|