| CPC G06F 9/4812 (2013.01) [G06F 9/526 (2013.01)] | 20 Claims |

|
1. A method comprising:
receiving a first interrupt request requesting to execute a first operation, wherein requesting to execute the first operation comprises requesting to occupy a critical resource that cannot be simultaneously occupied by a plurality of second operations, and wherein the second operations comprise the first operation;
storing, when the first operation is not to be executed immediately, the first operation into a temporary storage area storing an operation that occupies the critical resource and that a received interrupt request requests to execute,
wherein storing the first operation into the temporary storage area is based on a context corresponding to the first interrupt request being a first interrupt context; and
wherein the first interrupt request is further for requesting to execute a third operation different from the first operation, and wherein the method further comprises:
executing the third operation;
when executing the third operation has ended:
return a second interrupt context corresponding to a second interrupt request; or
return a task context, wherein a second priority of the second interrupt request is lower than a first priority of the first interrupt request; and
wherein to return the task context and the task context indicates that the third operation does not occupy the critical resource includes:
setting a mutual exclusion flag;
reading and executing at least one operation temporarily stored in the temporary storage area, wherein the at least one operation comprises the first operation; and
clearing the mutual exclusion flag when the temporary storage area does not comprise a remaining operation.
|