c - while look inside of a switch statement (double breaking) -



c - while look inside of a switch statement (double breaking) -

kinda silly command flow question:

basically have following,

switch(r){ case(0): while (x != true) { yield(); break; } do_important_work(); break; }

if status met (i.e. if x != true) want thread yield, , stop execution @ spot in code (i.e. kernel level context switch), , allow other process run, tried 1 time again later. problem break within while loop breaks out of while loop, not entire switch statement. want perform yield, , break out , allow context switch happen.

does create sense? it's way late , cant life of me find solution.

any help appreciated.

that build looks painful. break while, doesn't loop. in case can utilize if, this:

if (!x) { yield(); } else { do_important_work(); } break;

c operating-system

Comments

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -