Beispiel #1
0
void freerdp_chanman_free(rdpChanMan * chan_man)
{
	rdpChanManList * list;
	rdpChanManList * prev;

	freerdp_sem_free(chan_man->sync_data_sem);
	freerdp_sem_free(chan_man->event_sem);
	wait_obj_free(chan_man->signal);

	/* Remove from global list */
	freerdp_mutex_lock(g_mutex_list);
	for (prev = NULL, list = g_chan_man_list; list; prev = list, list = list->next)
	{
		if (list->chan_man == chan_man)
			break;
	}
	if (list)
	{
		if (prev)
			prev->next = list->next;
		else
			g_chan_man_list = list->next;
		xfree(list);
	}
	freerdp_mutex_unlock(g_mutex_list);

	xfree(chan_man);
}
Beispiel #2
0
void test_semaphore(void)
{
	freerdp_sem sem;

	sem = freerdp_sem_new(1);
	freerdp_sem_wait(sem);
	freerdp_sem_signal(sem);
	freerdp_sem_free(sem);
}