--- deliantra/server/include/cfperl.h 2006/12/31 17:17:23 1.45 +++ deliantra/server/include/cfperl.h 2007/01/01 00:41:03 1.46 @@ -386,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