… | |
… | |
147 | * and the single pointer value that is given to it as argument. |
147 | * and the single pointer value that is given to it as argument. |
148 | * |
148 | * |
149 | * Allocating/deallocating the stack is your own responsibility. |
149 | * Allocating/deallocating the stack is your own responsibility. |
150 | * |
150 | * |
151 | * As a special case, if coro, arg, sptr and ssize are all zero, |
151 | * As a special case, if coro, arg, sptr and ssize are all zero, |
152 | * then an "empty" coro_contetx will be created that is suitable |
152 | * then an "empty" coro_context will be created that is suitable |
153 | * as an initial source for coro_transfer. |
153 | * as an initial source for coro_transfer. |
154 | * |
154 | * |
155 | * This function is not reentrant, but putting a mutex around it |
155 | * This function is not reentrant, but putting a mutex around it |
156 | * will work. |
156 | * will work. |
157 | */ |
157 | */ |
… | |
… | |
172 | #endif |
172 | #endif |
173 | |
173 | |
174 | /* |
174 | /* |
175 | * The following prototype defines the coroutine destroy function. It is |
175 | * The following prototype defines the coroutine destroy function. It is |
176 | * usually implemented as a macro, so watch out. It also serves |
176 | * usually implemented as a macro, so watch out. It also serves |
177 | * no purpose unless you want to use the CORO_PTHREAD backend. |
177 | * no purpose unless you want to use the CORO_PTHREAD backend, |
|
|
178 | * where it is used to clean up the thread. You are responsible |
|
|
179 | * for freeing the stack and the context itself. |
178 | * |
180 | * |
179 | * This function is thread-safe and reentrant. |
181 | * This function is thread-safe and reentrant. |
180 | */ |
182 | */ |
181 | #if 0 |
183 | #if 0 |
182 | void coro_destroy (coro_context *ctx); |
184 | void coro_destroy (coro_context *ctx); |