mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 11:31:53 +01:00
Replaced boolean with enum in c'tor.
Implemented in a similar style to FPEnvironment.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user