Lines Matching refs:sem_ptr

138 	sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr;  local
146 if (sem_ptr->count == -1 || !sem_ptr->auto_release) {
147 efree(sem_ptr);
158 if (sem_ptr->count) {
161 sop[1].sem_op = sem_ptr->count;
167 semop(sem_ptr->semid, sop, opcount);
168 efree(sem_ptr);
195 sysvsem_sem *sem_ptr; in PHP_FUNCTION() local
287 sem_ptr = (sysvsem_sem *) emalloc(sizeof(sysvsem_sem)); in PHP_FUNCTION()
288 sem_ptr->key = key; in PHP_FUNCTION()
289 sem_ptr->semid = semid; in PHP_FUNCTION()
290 sem_ptr->count = 0; in PHP_FUNCTION()
291 sem_ptr->auto_release = auto_release; in PHP_FUNCTION()
293 sem_ptr->id = ZEND_REGISTER_RESOURCE(return_value, sem_ptr, php_sysvsem_module.le_sem); in PHP_FUNCTION()
303 sysvsem_sem *sem_ptr; in php_sysvsem_semop() local
316 …ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, &arg_id, -1, "SysV semaphore", php_sysvsem_module.le_s… in php_sysvsem_semop()
318 if (!acquire && sem_ptr->count == 0) { in php_sysvsem_semop()
319 …ARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key); in php_sysvsem_semop()
327 while (semop(sem_ptr->semid, &sop, 1) == -1) { in php_sysvsem_semop()
330 …E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(er… in php_sysvsem_semop()
336 sem_ptr->count -= acquire ? -1 : 1; in php_sysvsem_semop()
368 sysvsem_sem *sem_ptr; local
378 …ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, &arg_id, -1, "SysV semaphore", php_sysvsem_module.le_s…
382 if (semctl(sem_ptr->semid, 0, IPC_STAT, un) < 0) {
384 if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
391 if (semctl(sem_ptr->semid, 0, IPC_RMID, un) < 0) {
393 if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
403 sem_ptr->count = -1;