scheduling using real slots number

This commit is contained in:
Rongsong Shen 2025-12-30 18:13:15 +08:00
parent 8db4458375
commit 780e9fb313
22 changed files with 980 additions and 105 deletions

View file

@ -86,6 +86,36 @@ int xlist_iter(xlist_t* l, xlist_iter_fn_t fn, void* data)
return 0;
}
void* xlist_find(xlist_t* l, xlist_find_fn_t fn, ...)
{
int i;
va_list ap;
void* it = NULL;
if ((l == NULL) || (fn == NULL)) {
errno = EINVAL;
return NULL;
}
va_start(ap, fn);
for (i = 0; i < l->count; i++) {
va_list ap1;
int rc;
va_copy(ap1, ap);
rc = fn((void*)l->data[i], ap1);
va_end(ap1);
if (rc) {
it = (void*)l->data[i];
break;
}
}
return it;
}
void xlist_fini(xlist_t* l)
{
if (l == NULL) {