104. Destructors-II

Question.3

A developer controls the scope of interrupt disabling using braces:

void process() {
   // Interrupts enabled here
   {
       InterruptGuard guard; // Interrupts disabled
       critical_operation();
   } // guard destroyed -- interrupts re-enabled
   normal_operation();  // Interrupts enabled again
}

What technique does this demonstrate?

Need Help? Refer to the Quick Guide below

Select Answer