* *
% remove brandings and homepage [1] from copyright header. Pass 1 - using script.
[1] nobody has access to it anymore AFAIK - and it's also just
a redirect since long
! update url in copyright header
; this should make the diff between 3.4 and 3.2 easier to manage
30 lines
716 B
Plaintext
30 lines
716 B
Plaintext
/*
|
|
* demonstration/test code for thread return complex values
|
|
* and detached locals created by thread and used after thread
|
|
* termination.
|
|
*
|
|
* Copyright 2008 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
*
|
|
*/
|
|
|
|
#ifdef __XHARBOUR__
|
|
#xtranslate hb_threadStart( <x,...> ) => StartThread( <x> )
|
|
#xtranslate hb_threadJoin( <x,...> ) => JoinThread( <x> )
|
|
#endif
|
|
|
|
static s_var
|
|
proc main()
|
|
local xResult
|
|
? Version()
|
|
? "join:", hb_threadJoin( hb_threadStart( @thFunc() ), @xResult )
|
|
? "result:", xResult
|
|
? "static var type:", valtype( s_var )
|
|
? eval( s_var )
|
|
? eval( s_var )
|
|
return
|
|
|
|
func thFunc()
|
|
local i := 12345.678
|
|
s_var := {|| i++ }
|
|
return replicate( "Hello World!!! ", 3 )
|