Return -1 to the Mutex or Semaphore count if they are not counted (started without -Dd).
Don't include them in Engine status if not counted. git-svn-id: http://yate.null.ro/svn/yate/trunk@5545 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
03618a32ff
commit
2cf95d0cf8
|
@ -424,9 +424,13 @@ bool EngineStatusHandler::received(Message &msg)
|
||||||
msg.retValue() << ",threads=" << Thread::count();
|
msg.retValue() << ",threads=" << Thread::count();
|
||||||
msg.retValue() << ",workers=" << EnginePrivate::count;
|
msg.retValue() << ",workers=" << EnginePrivate::count;
|
||||||
msg.retValue() << ",mutexes=" << Mutex::count();
|
msg.retValue() << ",mutexes=" << Mutex::count();
|
||||||
msg.retValue() << ",locks=" << Mutex::locks();
|
int locks = Mutex::locks();
|
||||||
|
if (locks >= 0)
|
||||||
|
msg.retValue() << ",locks=" << locks;
|
||||||
msg.retValue() << ",semaphores=" << Semaphore::count();
|
msg.retValue() << ",semaphores=" << Semaphore::count();
|
||||||
msg.retValue() << ",waiting=" << Semaphore::locks();
|
locks = Semaphore::locks();
|
||||||
|
if (locks >= 0)
|
||||||
|
msg.retValue() << ",waiting=" << locks;
|
||||||
msg.retValue() << ",acceptcalls=" << lookup(Engine::accept(),Engine::getCallAcceptStates());
|
msg.retValue() << ",acceptcalls=" << lookup(Engine::accept(),Engine::getCallAcceptStates());
|
||||||
if (msg.getBoolValue("details",true)) {
|
if (msg.getBoolValue("details",true)) {
|
||||||
NamedIterator iter(Engine::runParams());
|
NamedIterator iter(Engine::runParams());
|
||||||
|
|
|
@ -611,7 +611,7 @@ int Mutex::count()
|
||||||
|
|
||||||
int Mutex::locks()
|
int Mutex::locks()
|
||||||
{
|
{
|
||||||
return MutexPrivate::s_locks;
|
return s_safety ? MutexPrivate::s_locks : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mutex::efficientTimedLock()
|
bool Mutex::efficientTimedLock()
|
||||||
|
@ -710,7 +710,7 @@ int Semaphore::count()
|
||||||
|
|
||||||
int Semaphore::locks()
|
int Semaphore::locks()
|
||||||
{
|
{
|
||||||
return SemaphorePrivate::s_locks;
|
return s_safety ? SemaphorePrivate::s_locks : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Semaphore::efficientTimedLock()
|
bool Semaphore::efficientTimedLock()
|
||||||
|
|
|
@ -4514,7 +4514,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of currently locked mutexes
|
* Get the number of currently locked mutexes
|
||||||
* @return Count of locked mutexes, should be zero at program exit
|
* @return Count of locked mutexes, -1 if unknown (not tracked)
|
||||||
*/
|
*/
|
||||||
static int locks();
|
static int locks();
|
||||||
|
|
||||||
|
@ -4649,7 +4649,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of currently locked (waiting) semaphores
|
* Get the number of currently locked (waiting) semaphores
|
||||||
* @return Count of locked semaphores, should be zero at program exit
|
* @return Count of locked semaphores, -1 if unknown (not tracked)
|
||||||
*/
|
*/
|
||||||
static int locks();
|
static int locks();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue