Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How start new program thread in Qore without race condition

I need start Program in new thread. Original program flows farther and pgm variable is destroyed before forked process references instance. Adding sleep is temporary hack. How to code it to avoid race ?

{
  Program pgm = new Program(...);
  ...
  background pgm.run();
  sleep(1);  # to avoid OBJECT-ALREADY-DELETED: attempt to access member 'pgm' of an already-deleted object of class 'DebugWrapper'
}
like image 721
TMa Avatar asked Dec 09 '25 03:12

TMa


1 Answers

upon further review this question appears to be invalid (there is no race condition) and the condition in the question cannot be reproduced (also confirmed with the questioner).

The issue in the original answer has also been closed as "not a bug" accordingly.

@TMa: can you please withdraw or cancel this question?

like image 128
David Nichols Avatar answered Dec 12 '25 08:12

David Nichols



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!