<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><font face="Helvetica, Arial,
sans-serif">First of all change </font>the order of lines 25-26<br>
inherited Create(False);<br>
FreeOnTerminate := True;<br>
<br>
instead of<br>
FreeOnTerminate := True;<br>
inherited Create(False);<br>
<br>
The, drop the DoExecute procedure and replace it by the Execute
procedure. It is useless to Synchronize a thread's procedure
inside itself !<br>
After the creation, the thread executes immediately the overriden
procedure Execute because, at creation time (inherited
Create(False); ) the thread is created in the state NON SUSPENDED.
The use of the DoExecute is obviously useless<br>
our program will execute the procedure Excute only once as there
is no loop.<br>
<br>
<br>
<div class="moz-signature">
<table
style="font-family:'Calibri','sans-serif';font-size:8.0pt;color:#002f87;border:0;width:auto;">
<tbody>
<tr>
<td style="vertical-align:bottom;padding:40px 20px
25px;border-top:1pt solid #BFBFBF;"> <img alt="Sita
Software"
src="cid:part1.06090305.04070706@sitasoftware.lu"> </td>
</tr>
<tr>
<td style="vertical-align: top; padding: 5px 20px 0;"> <b>Antonio
Fortuny</b><br>
Senior Software engineer<br>
<br>
220, avenue de la Liberté<br>
L-4602 Niederkorn<br>
Tel.: +352 58 00 93 - 93<br>
<a style="color:#002f87;cursor:pointer;text-decoration:
none;" href="http://www.sitasoftware.lu">www.sitasoftware.lu</a><br>
</td>
</tr>
<tr>
<td style="padding:20px 20px 30px;border-bottom: 1pt solid
#BFBFBF;" align="right"> <img alt="Your IT Partner"
src="cid:part3.00060804.04050700@sitasoftware.lu"> </td>
</tr>
</tbody>
</table>
</div>
Le 18/04/2013 07:03, silvioprog a écrit :<br>
</div>
<blockquote
cite="mid:CAKq_V2J=DizQnZVAW-bVa+pgASoOeiGwnj_J=q7ZhT+QVsKCnw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I tried to use TThread in a small sample, but it don't
works. The code is very simple, and I'm sending it in
attached.</div>
<div><br>
</div>
<div style="">Thanks,</div>
<div>
<div><br>
</div>
-- <br>
Silvio Clécio<br>
My public projects - <a moz-do-not-send="true"
href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a></pre>
</blockquote>
<br>
</body>
</html>