예제 #1
0
static int pthread_timer_ack(void *data, unsigned int quantity)
{
	struct pthread_timer *timer = data;

	ast_assert(quantity > 0);

	ao2_lock(timer);
	ack_ticks(timer, quantity);
	ao2_unlock(timer);

	return 0;
}
예제 #2
0
static int pthread_timer_ack(int handle, unsigned int quantity)
{
	struct pthread_timer *timer;

	ast_assert(quantity > 0);

	if (!(timer = find_timer(handle, 0))) {
		return -1;
	}

	ao2_lock(timer);
	ack_ticks(timer, quantity);
	ao2_unlock(timer);

	ao2_ref(timer, -1);

	return 0;
}