Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • i realised that the post is 4 years old from now but the answer can be useful to other people. Commented Feb 6, 2016 at 11:54
  • 3
    Protothreads change the control flow in thread functions, which is why they're implemented as macros. How Protothreads Really Work explains pretty well how they work. In short, there's a return 0 statement inside that while loop. Commented Feb 8, 2016 at 8:04
  • The macro PT_WAIT_UNTIL contains a return statement (executed depending on a condition) so what appears to be an infinite loop may not actually be an infinite loop. Commented Feb 29, 2016 at 12:57