|
|
1.1 root 1: //---------------------------------------------------------------------------
2:
3: #include <stdio.h> /* getchar */
4: #include <clx.h>
5: #include "TestThreadUnit.h"
6: #pragma hdrstop
7:
8: //---------------------------------------------------------------------------
9:
10: #pragma argsused
11: int main(int argc, char* argv[])
12: {
13: TTestThread* Thread=new TTestThread(true /* create suspended? */);
14: Thread->Resume();
15: Thread->ChildEvent->WaitFor(INFINITE); /* wait for thread to begin */
16: Thread->ChildEvent->ResetEvent();
17: for(int i=0;i<10;i++) {
18: printf("<parent>");
19: Thread->ParentEvent->SetEvent();
20: Thread->ChildEvent->WaitFor(INFINITE);
21: Thread->ChildEvent->ResetEvent();
22: }
23: Thread->WaitFor(); /* wait for thread to end */
24: return 0;
25: }
26: //---------------------------------------------------------------------------
27:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.