<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I'm not sure it works properly on windows.</p>
<p>When I modify this to start two threads, and print out messages
based on their start/stop times, as well as a message inside the
thread, I get both ending messages before I get only a single
printout from within the threaded function. This seems to
indicate windows isn't starting two threads, though I don't have a
clue how to verify this.</p>
<p>Just thought I'd add fuel to the fire here. :)</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 9/6/2020 1:00 PM, Paul Renaud via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:2006839799.767658.1599411600527@mail.yahoo.com">
<div class="yahoo-style-wrap">
<div dir="ltr" data-setdir="false">I
<div>Hello,<br>
<br>
I'm having a problem with the OS/2 version of the compiler.<br>
<br>
This simplified version of my program keeps generating an
exception<br>
when compiled and run in EComStation 1.2, OS/2 versions 4.5
and 4 <br>
but runs fine when compiled for Windows. <br>
<br>
Program Test1( Input, Output );<br>
<br>
{$S+}<br>
<br>
Const<br>
StackSize = 1000000;<br>
<br>
Max_Array = 5000;<br>
<br>
Type<br>
Data_Array = packed array[ 0 .. Max_Array ] of LongInt;<br>
<br>
Function MyThread( P: Pointer ): PtrInt;<br>
Var<br>
Data: Data_Array;<br>
Indexer: LongInt;<br>
Begin<br>
MyThread := 0;<br>
For Indexer := 1 to Max_Array do<br>
Data[ Indexer ] := 0;<br>
End; <br>
<br>
Var<br>
Handle: LongWord;<br>
My_Result: LongInt;<br>
Begin<br>
WriteLn( 'Test1 starting' );<br>
My_Result := BeginThread( @MyThread, Nil, Handle,
StackSize );<br>
<br>
My_Result := WaitForThreadTerminate( Handle, 0 );<br>
WriteLn( 'Test1 finished' );<br>
End.<br>
<br>
The error generated is...<br>
<br>
SYS1808:<br>
The process has stopped. The sofware diagnostic <br>
code (exception code) is 0005.<br>
<br>
the command I used to compile it is:<br>
<br>
fpc Test1.pas -Se -gl<br>
<br>
This exception appears to be generated before my thread gets
control,<br>
so I can't install my own exception handlers to intercept
it.<br>
<br>
Any help would be appreciated.<br>
Thanks,<br>
Paul.</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-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="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
</body>
</html>