Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-06

units precedence cthreads, variants

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi

I'm trying to track down 'Variant Array is locked' bug and during simulation on simple program i found the unit precedence problem.

--------------------------------------------------
program pokus1;
uses
  cthreads, variants, Classes;
type
  TTr = class(TThread)
    procedure Execute; override;
  end;
procedure TTr.Execute;
var
  v: Variant;
begin
  writeln('before');
  v := VarArrayOf(['1','2','3']);
  writeln('after');
end;
var
  tr: TTr;
begin
  tr:=TTr.Create(False);
end.
--------------------------------------------------

If unit cthreads are before variants then i get:
-------------------------------------------------- before

Program needs probably the variants unit.
Include the variants unit in your uses statements
as one of the first units.

--------------------------------------------------

If unit variants are before cthreads then:
-------------------------------------------------- Threading has been used before cthreads was initialized. Make cthreads one of the first units in your uses clause. Runtime error 211 at $08065B87
$08065B87
$080551CE
$08048440

--------------------------------------------------

Linux, fpc from svn

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Unknown author
to Unknown author
Show quoted text 57 lines
Hi I'm trying to track down 'Variant Array is locked' bug and during simulation on simple program i found the unit precedence problem. -------------------------------------------------- program pokus1; uses cthreads, variants, Classes; type TTr = class(TThread) procedure Execute; override; end; procedure TTr.Execute; var v: Variant; begin writeln('before'); v := VarArrayOf(['1','2','3']); writeln('after'); end; var tr: TTr; begin tr:=TTr.Create(False); end. -------------------------------------------------- If unit cthreads are before variants then i get: -------------------------------------------------- before Program needs probably the variants unit. Include the variants unit in your uses statements as one of the first units. -------------------------------------------------- If unit variants are before cthreads then: -------------------------------------------------- Threading has been used before cthreads was initialized. Make cthreads one of the first units in your uses clause. Runtime error 211 at $08065B87 $08065B87 $080551CE $08048440 -------------------------------------------------- Linux, fpc from svn Petr

Please, can somebody advise me how I can make program with threads and variants simultaneously.

Thanks
Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email