From: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Date: Thu, 1 Mar 2012 15:44:43 +0000 (+0100)
Subject: Use xbt_die instead of throwing an std::logic_error exception.
X-Git-Tag: exp_20120308~12
X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/5ca20b5b1308faecf94f7ea1f3d91bc25f4c7903?ds=inline;hp=7594a30eb5ef2059cf4a04773c7ce101378d4fca

Use xbt_die instead of throwing an std::logic_error exception.
---

diff --git a/msg_thread.cpp b/msg_thread.cpp
index 41c4bfb..35ee01a 100644
--- a/msg_thread.cpp
+++ b/msg_thread.cpp
@@ -23,14 +23,14 @@ msg_thread::msg_thread(const char* name)
 msg_thread::~msg_thread()
 {
     if (thread)
-        throw std::logic_error("trying to destroy running thread");
+        xbt_die("ERROR: trying to destroy running thread");
 }
 
 void msg_thread::start()
 {
     mutex.acquire();
     if (started)
-        throw std::logic_error("thread was already started");
+        xbt_die("ERROR: thread was already started");
     XBT_DEBUG("launch \"%s\"", thread_name.c_str());
     thread = MSG_process_create(thread_name.c_str(),
                                 msg_thread::start_wrapper,
@@ -43,7 +43,7 @@ void msg_thread::wait()
 {
     mutex.acquire();
     if (!started)
-        throw std::logic_error("trying to wait a thread that was not started");
+        xbt_die("ERROR: trying to wait for a thread that was not started");
     while (thread) {
         XBT_DEBUG("waiting for \"%s\" to terminate",
                   thread_name.c_str());