Esempio n. 1
0
BOOL UtJoin(HANDLE ThreadHandle) {
	PUTHREAD Uthread = (PUTHREAD)ThreadHandle;
	if (Uthread == RunningThread || !UtAlive(ThreadHandle)) return FALSE;
	RunningThread->State = BLOCKED;
	InsertTailList(&Uthread->Joiners, &RunningThread->Link);
	UtDeactivate();
	return TRUE;
}
Esempio n. 2
0
VOID PrintUtThreadAlive(HANDLE handle[]) {
	ULONG Index;
	for (Index = 0; Index < MAX_THREADS; ++Index) {
		printf("Client %d:  %d  (1-Alive; 0-Dead)", Index, UtAlive(handle[Index]));
		printf("\n");
	}
	getchar();
}