Replaced boolean with enum in c'tor.

Implemented in a similar style to FPEnvironment.
This commit is contained in:
martin-osborne
2015-01-14 10:48:22 +00:00
parent f9942829d3
commit 00b568193c
12 changed files with 59 additions and 23 deletions

View File

@@ -21,15 +21,16 @@
namespace Poco {
MutexImpl::MutexImpl(bool recursive)
MutexImpl::MutexImpl(MutexTypeImpl type)
{
if (recursive)
switch (type)
{
case MUTEX_RECURSIVE_IMPL:
_sem = semMCreate(SEM_INVERSION_SAFE | SEM_Q_PRIORITY);
}
else
{
break;
case MUTEX_NONRECURSIVE_IMPL:
_sem = semBCreate(SEM_Q_PRIORITY, SEM_FULL);
break;
}
if (_sem == 0)
throw Poco::SystemException("cannot create mutex");