--- deliantra/server/include/cfperl.h 2006/12/30 15:07:59 1.43 +++ deliantra/server/include/cfperl.h 2007/01/01 00:41:03 1.46 @@ -37,6 +37,7 @@ #undef do_open #undef do_close #undef ref +#undef seed // perl bug #40256: perl does overwrite those with reentrant versions // but does not initialise their state structures. @@ -249,7 +250,7 @@ *p = '\n'; } - void put (keyword k, const char *v) + void put (keyword k, const char *v = 0) { put_string (k, v); } @@ -385,6 +386,19 @@ static int nready () { return CORO_NREADY; } static int cede () { return CORO_CEDE ; } + + static int cede_counter; + + static void cede_every (int count) + { + if (++cede_counter >= count) + { + cede_counter = 0; + + if (coroapi::nready ()) + coroapi::cede (); + } + } }; struct watcher_base