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'
}
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With