File:  [Synchronet] / sbbs / xpdev / clx / mainunit.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>	/* getchar */
#include <clx.h>
#include "TestThreadUnit.h"
#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
int main(int argc, char* argv[])
{
	TTestThread* Thread=new TTestThread(true /* create suspended? */);
    Thread->Resume();
    Thread->ChildEvent->WaitFor(INFINITE);	/* wait for thread to begin */
    Thread->ChildEvent->ResetEvent();
    for(int i=0;i<10;i++) {
        printf("<parent>");
        Thread->ParentEvent->SetEvent();
        Thread->ChildEvent->WaitFor(INFINITE);
        Thread->ChildEvent->ResetEvent();
    }
    Thread->WaitFor();	/* wait for thread to end */
	return 0;
}
//---------------------------------------------------------------------------
 

unix.superglobalmegacorp.com

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