Skip to content

Commit

Permalink
replace throw inside desctructor by abort
Browse files Browse the repository at this point in the history
it's a part of the issue #72
  • Loading branch information
p-alik committed May 18, 2017
1 parent e3dbdda commit a1e4dd9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libtest/thread.hpp
Expand Up @@ -56,7 +56,8 @@ class Mutex
{
if ((_err= pthread_mutex_destroy(&_mutex)))
{
throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "pthread_cond_destroy: %s", strerror(_err));
libtest::stream::make_cerr(LIBYATL_DEFAULT_PARAM) << "pthread_cond_destroy: " << strerror(_err);
abort();
}
}

Expand Down Expand Up @@ -89,7 +90,8 @@ class ScopedLock
int err;
if ((err= pthread_mutex_unlock(_mutex.handle())))
{
throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "pthread_mutex_unlock: %s", strerror(err));
libtest::stream::make_cerr(LIBYATL_DEFAULT_PARAM) << "pthread_mutex_unlock: " << strerror(err);
abort();
}
}

Expand Down Expand Up @@ -129,7 +131,8 @@ class Condition
int err;
if ((err= pthread_cond_destroy(&_cond)))
{
throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "pthread_cond_destroy: %s", strerror(err));
libtest::stream::make_cerr(LIBYATL_DEFAULT_PARAM) << "pthread_cond_destroy: " << strerror(err);
abort();
}
}

Expand Down

0 comments on commit a1e4dd9

Please sign in to comment.