Tried to post this on <https://sourceforge.net/p/oorexx/bugs/1561/>, however 
Sourceforge always gets
back with a "broken page" error, which I reported to Sourceforge.

Maybe opening a new track item would be helpful, in the meantime posting it 
here.

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

In the method "update_gui_from_rexx_thread" it is the loop: "loop i=1 while 
stopRexxThread<>.true"
in the below code segment.

If an external function call like "BsfTestPing" is used (it returns 
immediately), then it appears to
be hung, using sysSleep() or bsfGetTid() consumes more time and the label gets 
updated and
interacting with the button succeeds.

~~~

::class SOME_REXX_CLASS --
::attribute stopRexxThread CLASS UNGUARDED   -- allow concurrent interactions 
with attribute

::method update_gui_from_rexx_thread class -- will only be invoked on the Java 
GUI thread
  expose stopRexxThread
  use arg label         -- GUI object to interact with
  say self"::updateGuiFromRexxThread - just arrived, GUI thread:" bsfGetTid()
  reply
  tid=bsfGetTid()
  say self"::updateGuiFromRexxThread - now running on thread:" tid
  stopRexxThread=.false
  startDateTime=.dateTime~new    -- take start date and time
  loop i=1 while stopRexxThread<>.true
     now=.dateTime~new           -- take current date and time
     duration=now-startDateTime  -- calculation duration

     if duration~totalMicroseconds=0 then -- in the beginning ooRexx could be 
too fast :)
        loopSec=""
     else      -- show loops per seconds
        loopsSec=", 
loops/sec="pp(myFormat(format((i/duration~totalMicroseconds)*1000000,,0)))

     str=now || loopsSec", loop #" myFormat(i)": value from non-GUI Rexx 
thread" pp(tid)
     .FxGuiThread~runLaterLatest(label, "setText", "i", str)
     -- call SysSleep .0001   -- sleep a bit, relinquishes the Rexx thread
-- call sysSleep 0   -- slows loop down by 1/5, no hangs
-- call bsfgettid    -- slows loop down by 1/6, no hangs
-- call bsfTestPing  -- just returns without an argument: will cause eventual 
hang on Linux
  end
  say self"::updateGuiFromRexxThread - now stopping executing on thread:" tid
  say

~~~



_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to