File:  [Synchronet] / sbbs / xpdev / clx / testthreadunit.cpp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:41:22 2018 UTC (8 years, 3 months ago) by root
Branches: digitaldynamics, MAIN
CVS tags: v3_12a, HEAD
3.12a Javascript

//---------------------------------------------------------------------------
#include <stdio.h>	/* printf */
#pragma hdrstop

#include "TestThreadUnit.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
__fastcall TTestThread::TTestThread(bool CreateSuspended)
	: TThread(CreateSuspended)
{
	ChildEvent = new TSimpleEvent();
    ParentEvent = new TSimpleEvent();
}
//---------------------------------------------------------------------------
void __fastcall TTestThread::Execute()
{
	printf("TestThread::Execute() entry\n");
	ChildEvent->SetEvent();

	for(int i=0;i<10;i++) {
        ParentEvent->WaitFor(INFINITE);
    	ParentEvent->ResetEvent();
		printf(" <child>\n");
		ChildEvent->SetEvent();
	}

	printf("thread_test exit\n");
}
//---------------------------------------------------------------------------
 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.