Exemplo n.º 1
0
static void* jni_channels_thread(void* arg)
{     
	int status;
	HANDLE event;
	rdpChannels* channels;
	freerdp* instance = (freerdp*) arg;
	
	assert(NULL != instance);
											  
	DEBUG_ANDROID("Channels_thread Start.");

	channels = instance->context->channels;
	event = freerdp_channels_get_event_handle(instance);

	while (WaitForSingleObject(event, INFINITE) == WAIT_OBJECT_0)
	{
		status = freerdp_channels_process_pending_messages(instance);

		if (!status)
			break;
	}
	
	DEBUG_ANDROID("channels_thread Quit.");

	ExitThread(0);
	return NULL;
} 
Exemplo n.º 2
0
void* rds_channels_thread(void* arg)
{
	int status;
	DWORD nCount;
	rdsContext* rds;
	HANDLE events[8];
	rdpChannels* channels;
	freerdp* instance = (freerdp*) arg;

	rds = (rdsContext*) instance->context;
	channels = instance->context->channels;

	nCount = 0;
	events[nCount++] = rds->StopEvent;
	events[nCount++] = freerdp_channels_get_event_handle(instance);

	while (1)
	{
		WaitForMultipleObjects(nCount, events, FALSE, INFINITE);

		if (WaitForSingleObject(rds->StopEvent, 0) == WAIT_OBJECT_0)
		{
			break;
		}

		status = freerdp_channels_process_pending_messages(instance);

		if (!status)
			break;
	}

	ExitThread(0);
	return NULL;
}