diff --git a/libs/main/math/pimathmatrix.h b/libs/main/math/pimathmatrix.h index 897fe6ae..3f89c4b5 100644 --- a/libs/main/math/pimathmatrix.h +++ b/libs/main/math/pimathmatrix.h @@ -34,7 +34,7 @@ * @param v is input parameter of type T * @return true if zero, false if not zero */ -template +template::value, int>::type = 0> inline bool _PIMathMatrixNullCompare(const T v) { static_assert(std::is_floating_point::value, "Type must be floating point"); return (piAbs(v) < T(1E-200)); @@ -46,22 +46,16 @@ inline bool _PIMathMatrixNullCompare(const T v) { * @param v is input parameter of type colmplexf * @return true if zero, false if not zero */ -template<> -inline bool _PIMathMatrixNullCompare(const complexf v) { +template::value || + std::is_floating_point::value + , int>::type = 0> +inline bool _PIMathMatrixNullCompare(const T v) { + static_assert(std::is_floating_point::value, "Type must be floating point"); + static_assert(std::is_floating_point::value, "Type must be floating point"); return (abs(v) < float(1E-200)); } -/** -* @brief Inline funtion of compare with zero complexd type -* -* @param v is input parameter of type colmplexd -* @return true if zero, false if not zero -*/ -template<> -inline bool _PIMathMatrixNullCompare(const complexd v) { - return (abs(v) < double(1E-200)); -} - /// Matrix templated diff --git a/libs/main/thread/pimutex.cpp b/libs/main/thread/pimutex.cpp index 2c0a97b2..e605f3b4 100644 --- a/libs/main/thread/pimutex.cpp +++ b/libs/main/thread/pimutex.cpp @@ -105,7 +105,7 @@ void PIMutex::init() { pthread_mutexattr_t attr; memset(&attr, 0, sizeof(attr)); pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); memset(&(PRIVATE->mutex), 0, sizeof(PRIVATE->mutex)); pthread_mutex_init(&(PRIVATE->mutex), &attr); pthread_mutexattr_destroy(&attr);