Add Exception message to Mutex

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2021-05-11 13:57:22 +09:00
parent 9a22c1bd7e
commit dd13618845

View File

@@ -131,11 +131,11 @@ void Mutex::lock(void)
{
if (pthread_mutex_lock(&_mutex))
{
throw;
throw Exception("Mutex lock error", errno);
}
} catch (char* errmsg)
{
throw Exception("The same thread can't acquire a mutex twice.", -1);
throw Exception("The same thread can't acquire a mutex twice", errno);
}
}
}
@@ -153,7 +153,7 @@ void Mutex::unlock(void)
{
if (pthread_mutex_unlock(&_mutex))
{
throw;
throw Exception("Mutex unlock error", errno);
}
} catch (char* errmsg)
{