Lines Matching refs:pool
109 SemaphorePoolInit(struct SemaphorePool *pool)
111 pool->fPool=NULL;
112 pool->fPoolCount=0;
113 pool->fPoolSize=0;
115 pool->fPoolSem=create_sem(1,"semaphore_pool_sem");
116 set_sem_owner (pool->fPoolSem,B_SYSTEM_TEAM);
120 SemaphorePoolDestroy(struct SemaphorePool *pool)
124 for (i=0;i<pool->fPoolCount;i++)
125 delete_sem (pool->fPool[i]);
127 free (pool->fPool);
129 delete_sem (pool->fPoolSem);
133 SemaphorePoolGet(struct SemaphorePool *pool)
137 while (acquire_sem(pool->fPoolSem)==B_INTERRUPTED)
141 if (pool->fPoolCount==0)
145 while (release_sem(pool->fPoolSem)==B_INTERRUPTED)
152 sem=pool->fPool[pool->fPoolCount-1];
153 pool->fPoolCount--;
155 while (release_sem(pool->fPoolSem)==B_INTERRUPTED)
163 SemaphorePoolPut(struct SemaphorePool *pool, sem_id sem)
165 while (acquire_sem(pool->fPoolSem)==B_INTERRUPTED)
169 if (pool->fPoolCount+1>pool->fPoolSize)
171 pool->fPoolSize+=8;
172 pool->fPool=(sem_id *)realloc(pool->fPool,pool->fPoolSize*sizeof(sem_id));
175 pool->fPool[pool->fPoolCount]=sem;
176 pool->fPoolCount++;
178 while (release_sem(pool->fPoolSem)==B_INTERRUPTED)