瀏覽代碼

* Thread in lib demo - main window = main thread

Michael Van Canneyt 9 月之前
父節點
當前提交
10d2c51c02

+ 4 - 0
demo/wasienv/threads/demothreads.lpi

@@ -44,6 +44,10 @@
           <Item0 Name="PasJSIsProjectHTMLFile" Value="1"/>
         </CustomData>
       </Unit>
+      <Unit>
+        <Filename Value="../../../packages/wasi/src/rtl.threadcontroller.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
     </Units>
   </ProjectOptions>
   <CompilerOptions>

+ 1 - 1
demo/wasienv/threads/demothreads.lpr

@@ -4,7 +4,7 @@ program demowasithreads;
 
 uses
   browserconsole, browserapp, JS, Classes, SysUtils, Web, WebAssembly, types,
-  wasienv, Rtl.WebThreads, wasihostapp, wasithreadedapp ;
+  wasienv, Rtl.WebThreads, wasihostapp, wasithreadedapp, rtl.threadcontroller ;
 
 Type
 

+ 1 - 1
demo/wasienv/threads/index.html

@@ -40,7 +40,7 @@
         <div>
           <p>Created using &nbsp; <a target="_blank" href="https://wiki.freepascal.org/pas2js">pas2js.</a> </p>
           <p>Pas2JS Sources: &nbsp; <a target="new" href="demothreads.lpr">Pas2JS Program</a></p>
-          <p>Webassembly Sources: &nbsp; <a target="new" href="threadedapp.pp">FPC Program</a></p>
+          <p>Webassembly Sources: &nbsp; <a target="new" href="threadapp.lpr">FPC Program</a></p>
         </div>
       </div>
     </div>

+ 1 - 4
demo/wasienv/threads/threadapp.lpr

@@ -1,4 +1,4 @@
-library threadlib;
+library threadapp;
 {$mode objfpc}
 {$h+}
 {$i-}
@@ -45,9 +45,6 @@ begin
   With TCalcThread.Create(False) do
     begin
     DebugWriteln('Thread created');
-//    While true do
-//      DebugWriteln('Waiting for thread');
-//    DebugWriteln('thread ended');
     end;
 end;