… | |
… | |
248 | } |
248 | } |
249 | |
249 | |
250 | *p = '\n'; |
250 | *p = '\n'; |
251 | } |
251 | } |
252 | |
252 | |
253 | void put (keyword k, const char *v) |
253 | void put (keyword k, const char *v = 0) |
254 | { |
254 | { |
255 | put_string (k, v); |
255 | put_string (k, v); |
256 | } |
256 | } |
257 | |
257 | |
258 | void put (keyword k, const shstr &v) |
258 | void put (keyword k, const shstr &v) |
… | |
… | |
384 | struct coroapi { |
384 | struct coroapi { |
385 | static struct CoroAPI *GCoroAPI; |
385 | static struct CoroAPI *GCoroAPI; |
386 | |
386 | |
387 | static int nready () { return CORO_NREADY; } |
387 | static int nready () { return CORO_NREADY; } |
388 | static int cede () { return CORO_CEDE ; } |
388 | static int cede () { return CORO_CEDE ; } |
|
|
389 | |
|
|
390 | static int cede_counter; |
|
|
391 | |
|
|
392 | static void cede_every (int count) |
|
|
393 | { |
|
|
394 | if (++cede_counter >= count) |
|
|
395 | { |
|
|
396 | cede_counter = 0; |
|
|
397 | |
|
|
398 | if (coroapi::nready ()) |
|
|
399 | coroapi::cede (); |
|
|
400 | } |
|
|
401 | } |
389 | }; |
402 | }; |
390 | |
403 | |
391 | struct watcher_base |
404 | struct watcher_base |
392 | { |
405 | { |
393 | static struct EventAPI *GEventAPI; |
406 | static struct EventAPI *GEventAPI; |