Recent

Author Topic: [Solved] WThread Linux 32  (Read 1313 times)

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
[Solved] WThread Linux 32
« on: December 11, 2019, 02:57:14 pm »
Hi, we're using this component (WThread) for a cross platform application. In a form we're using it to query some data from internet to display a QR code. It works on Linux 64 but I'm having issues on Linux 32. The QR is never displayed.

Anyone can confirm wthread works correctly on Linux 32? I'm using Ubuntu 16.04.

https://github.com/wadman/wthread
« Last Edit: December 12, 2019, 10:24:55 pm by lainz »

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: WThread Linux 32
« Reply #1 on: December 11, 2019, 03:31:33 pm »
Anyone can confirm wthread works correctly on Linux 32? I'm using Ubuntu 16.04.

It would be better if you setup a minimal test project. How should one know if it "works correctly"?
Not to say linked page contains windows-only code.
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: WThread Linux 32
« Reply #2 on: December 11, 2019, 04:08:40 pm »
Yes, you're right.

Well there are 4 demo projects in that repository. Seems that are not Windows only like the demo in the main page.

In my project works on Windows and Linux 64. So if it crashes the application (what it does for me on Linux 32) it doesn't works, that's the test.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: WThread Linux 32
« Reply #3 on: December 12, 2019, 12:49:38 am »
The test works fine on Linux 32, the OnFinish event fires... so is our program. Maybe accessing object variables between threads. But it's strange it works fine on Linux 64 and Win32.
« Last Edit: December 12, 2019, 12:53:17 am by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: [Solved] WThread Linux 32
« Reply #4 on: December 12, 2019, 10:26:14 pm »
Finally I used a normal TThread descendant, instead of using OnFinish event, I use Synchronize. Instead of starting tasks from OnFinish (maybe this was the faulty code), I start them in the Execute part or any method that was called from Execute, never from Synchronize and it works.

 

TinyPortal © 2005-2018