On 6/3/22 18:17, Steven Schveighoffer wrote:

> If a thread does not catch an error and end the program

No, the thread dies and the main thread doesn't know anything about it. Unless if std.concurrency is being used and the main thread looks for and receives a LinkTerminated message. (If spawnLinked was used to start the thread.)

But still, there is no trace of the Error. So I do the following in my thread functions:

void myThread() {
  try {

  } catch (Exception exc) {
     // ...

  } catch (Error exc) {
    // Report on stderr
    exit(1); // Yes, takes down the main thread.
             // Could choose to do otherwise...
  }
}

Ali

  • Comparing Exceptions and Erro... Steven Schveighoffer via Digitalmars-d-learn
    • Re: Comparing Exceptions... Ali Çehreli via Digitalmars-d-learn
      • Re: Comparing Except... Steven Schveighoffer via Digitalmars-d-learn
        • Re: Comparing Ex... Ali Çehreli via Digitalmars-d-learn
        • Re: Comparing Ex... Ola Fosheim Grøstad via Digitalmars-d-learn
          • Re: Comparin... Sebastiaan Koppe via Digitalmars-d-learn
            • Re: Com... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Sebastiaan Koppe via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Adam Ruppe via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Adam D Ruppe via Digitalmars-d-learn

Reply via email to