mirror of
https://github.com/upa/mscp.git
synced 2026-02-15 01:34:44 +08:00
change thread_list to thread_pool
This commit is contained in:
@@ -61,6 +61,7 @@ int pool_push(pool *p, void *v)
|
||||
p->array = new;
|
||||
}
|
||||
p->array[p->num] = v;
|
||||
__sync_synchronize();
|
||||
p->num++;
|
||||
return 0;
|
||||
}
|
||||
@@ -88,6 +89,11 @@ void *pool_pop_lock(pool *p)
|
||||
return v;
|
||||
}
|
||||
|
||||
void *pool_get(pool *p, unsigned int idx)
|
||||
{
|
||||
return p->num <= idx ? NULL : p->array[idx];
|
||||
}
|
||||
|
||||
void *pool_iter_next(pool *p)
|
||||
{
|
||||
if (p->num <= p->idx)
|
||||
|
||||
Reference in New Issue
Block a user