libaco icon indicating copy to clipboard operation
libaco copied to clipboard

Add aco_yield_to()

Open AltraMayor opened this issue 5 years ago • 0 comments

This pull request introduces aco_yield_to() that enables a non-main co to yield to another co with a single context switch.

The first patch, namely add aco_yield_to(), seems a little complicated because part of the code of aco_resume() is moved to a new auxiliary function called aco_own_stack() to avoid duplicating code at aco_yield_to(). Ignoring this code movement, the additions are straightforward.

The second patch adds test_aco_tutorial_7.c to test and show how to use aco_yield_to().

This pull request closes #31

AltraMayor avatar Oct 24 '19 21:10 AltraMayor