diff --git a/ChangeLog.txt b/ChangeLog.txt index d0ca2b6cb1..6e6a1db8d9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,12 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-06-04 15:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * tests/mt/mttest10.prg + + allow to chose GT passing it's name as command line argument + + initialize GT in main thread if GT needs it + (currently QTC needs initialization in main thread) + 2013-06-04 14:20 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/gtqtc/gtqtc1.cpp * added workaround for missing MT synchronization in QT for XLIB diff --git a/tests/mt/mttest10.prg b/tests/mt/mttest10.prg index 5c84f2f55d..1f81f4e8f6 100644 --- a/tests/mt/mttest10.prg +++ b/tests/mt/mttest10.prg @@ -18,7 +18,7 @@ #define THREAD_GT "XWC" #endif -proc main() +proc main( cGT ) local i, aThreads if ! hb_mtvm() @@ -26,10 +26,19 @@ proc main() quit endif + if empty( cGT ) + cGT := THREAD_GT + endif + + if cGT == "QTC" .and. ! cGT == hb_gtVersion() + /* QTC have to be initialized in main thread */ + hb_gtReload( cGT ) + endif + ? "Starting threads..." aThreads := {} for i := 1 to 3 - aadd( aThreads, hb_threadStart( @thFunc() ) ) + aadd( aThreads, hb_threadStart( @thFunc(), cGT ) ) ? i, "=>", atail( aThreads ) next @@ -43,9 +52,13 @@ proc main() enddo return -proc thFunc() +proc thFunc( cGT ) /* allocate own GT driver */ - hb_gtReload( THREAD_GT ) - use test shared + hb_gtReload( cGT ) + if ! dbExists( "test" ) .and. dbExists( "../test" ) + use ../test shared + else + use test shared + endif browse() return