示例#1
0
文件: php_ticks.c 项目: Doap/php-src
PHPAPI void php_remove_tick_function(void (*func)(int))
{
	TSRMLS_FETCH();

	zend_llist_del_element(&PG(tick_functions), (void *)func,
						   (int(*)(void*, void*))php_compare_tick_functions);
}
示例#2
0
void
apd_summary_output_exit_function(int index, int mem)
{
	void *entry;
	TSRMLS_FETCH();

	entry = apd_array_get(&APD_GLOBALS(summary).functions, index);
	if (entry == NULL) {
		return;
	}

	zend_llist_del_element(&APD_GLOBALS(summary).call_list, entry, compare_fcall);
}
示例#3
0
/* {{{ pop for php */
size_t pthreads_stack_pop(PTHREAD thread, PTHREAD work TSRMLS_DC) {
    zend_bool locked;
    int remain = 0;

    if (pthreads_lock_acquire(thread->lock, &locked TSRMLS_CC)) {
        zend_llist *stack = &thread->stack->objects;
        if (work) {
            zend_llist_del_element(stack, &work, (int (*)(void *, void *)) pthreads_equal_func);
        } else zend_llist_destroy(stack);
        remain = stack->count;
        pthreads_lock_release(thread->lock, locked TSRMLS_CC);
    } else remain = -1;
    return remain;
} /* }}} */
示例#4
0
/* {{{ pop for php */
int pthreads_stack_pop_ex(PTHREAD thread, PTHREAD work TSRMLS_DC) {
	int acquire = 0;
	int remain = 0;
	
	acquire = PTHREADS_LOCK(thread);
	if (acquire == SUCCESS || acquire == EDEADLK) {
		if (work) {
			zend_llist_del_element(thread->stack, &work, (int (*)(void *, void *)) pthreads_equal_func);
		} else zend_llist_destroy(thread->stack);
		remain = thread->stack->count;
		if (acquire != EDEADLK)
			PTHREADS_UNLOCK(thread);
	} else zend_error(E_ERROR, "pthreads has suffered an internal error and cannot continue: %d", acquire);
	return remain;
} /* }}} */
示例#5
0
文件: object.c 项目: n3b/pthreads
/* {{{ pop for php */
int pthreads_stack_pop(PTHREAD thread, PTHREAD work TSRMLS_DC) {
	int acquire = 0;
	int remain = 0;
	
	acquire = pthread_mutex_lock(thread->lock);
	if (acquire == SUCCESS || acquire == EDEADLK) {
		zend_llist *stack = &thread->stack->objects;
		if (work) {
			zend_llist_del_element(stack, &work, (int (*)(void *, void *)) pthreads_equal_func);
		} else zend_llist_destroy(stack);
		remain = stack->count;
		if (acquire != EDEADLK)
			pthread_mutex_unlock(thread->lock);
	} else remain = -1;
	return remain;
} /* }}} */
示例#6
0
PHPAPI void php_remove_tick_function(void (*func)(int, void *), void * arg)
{
	struct st_tick_function tmp = {func, arg};
	zend_llist_del_element(&PG(tick_functions), (void *)&tmp, (int(*)(void*, void*))php_compare_tick_functions);
}