* package/*
* src/compiler/harbour.y
* src/compiler/harbour.yyc
* src/macro/macro.y
* src/macro/macro.yyc
* src/pp/hbpp.1
* tests/*/*
* utils/*
* stripped svn header manually
* tests/hbdocext.hb
* tests/lang2po.hb
* tests/big5_gen.prg
* tests/uc16_gen.prg
* do not add svn ids to generated sources
+ tests/stripsvn.hb
+ added script to strip svn header from sources
52 lines
1.0 KiB
Plaintext
52 lines
1.0 KiB
Plaintext
/*
|
|
* Harbour Project source code:
|
|
* demonstration/test code for using independent console window in
|
|
* different thread. It needs GT driver which supports such functionality.
|
|
*
|
|
* Copyright 2008 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
* www - http://harbour-project.org
|
|
*
|
|
*/
|
|
|
|
#include "inkey.ch"
|
|
|
|
#ifdef __PLATFORM__WINDOWS
|
|
REQUEST HB_GT_WVT_DEFAULT
|
|
#define THREAD_GT hb_gtVersion()
|
|
#else
|
|
REQUEST HB_GT_STD_DEFAULT
|
|
#define THREAD_GT "XWC"
|
|
#endif
|
|
|
|
proc main()
|
|
local i, aThreads
|
|
|
|
if ! hb_mtvm()
|
|
? "This program needs HVM with MT support"
|
|
quit
|
|
endif
|
|
|
|
? "Starting threads..."
|
|
aThreads := {}
|
|
for i := 1 to 3
|
|
aadd( aThreads, hb_threadStart( @thFunc() ) )
|
|
? i, "=>", atail( aThreads )
|
|
next
|
|
|
|
? "Waiting for threads"
|
|
while inkey() != K_ESC
|
|
if hb_threadWait( aThreads, 0.1, .T. ) == len( aThreads )
|
|
wait
|
|
exit
|
|
endif
|
|
?? "."
|
|
enddo
|
|
return
|
|
|
|
proc thFunc()
|
|
/* allocate own GT driver */
|
|
hb_gtReload( THREAD_GT )
|
|
use test shared
|
|
browse()
|
|
return
|