Esempio n. 1
0
void uaenet_close (void *vsd)
{
	struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)vsd;
	if (!sd)
		return;
	if (sd->threadactiver) {
		sd->threadactiver = -1;
	}
	if (sd->threadactivew) {
		sd->threadactivew = -1;
		SetEvent (sd->evttw);
	}
	if (sd->threadactiver) {
		while (sd->threadactiver)
			Sleep(10);
		write_log (L"uaenet_win32 thread %d killed\n", sd->tidr);
		uae_end_thread (&sd->tidr);
	}
	if (sd->threadactivew) {
		while (sd->threadactivew)
			Sleep(10);
		CloseHandle (sd->evttw);
		write_log (L"uaenet_win32 thread %d killed\n", sd->tidw);
		uae_end_thread (&sd->tidw);
	}
	xfree (sd->readbuffer);
	xfree (sd->writebuffer);
	if (sd->fp)
		pcap_close (sd->fp);
	uaeser_initdata (sd, sd->user);
	write_log (L"uaenet_win32 closed\n");
}
Esempio n. 2
0
void uaenet_close (struct uaenetdata *sd)
{
	if (!sd)
		return;
	if (sd->threadactiver) {
		sd->threadactiver = -1;
	}
	if (sd->threadactivew) {
		sd->threadactivew = -1;
// REMOVEME: win32 specific
//		SetEvent (sd->evttw);
	}
	if (sd->threadactiver) {
		while (sd->threadactiver)
			sleep_millis(10);
		write_log ("uaenet_ thread %d killed\n", sd->tidr);
		uae_kill_thread (&sd->tidr);
	}
	if (sd->threadactivew) {
		while (sd->threadactivew)
			sleep_millis(10);
// REMOVEME: win32 specific
//		CloseHandle (sd->evttw);
		write_log ("uaenet thread %d killed\n", sd->tidw);
		uae_kill_thread (&sd->tidw);
	}
	xfree (sd->readbuffer);
	xfree (sd->writebuffer);
	if (sd->fp)
		pcap_close (sd->fp);
	uaeser_initdata (sd, sd->user);
	write_log ("uaenet_win32 closed\n");
}