Added separate object counter for worker threads.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5784 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
6565a427ff
commit
ed9f8d7707
|
@ -239,6 +239,7 @@ static SharedVars s_vars;
|
||||||
static Mutex s_hooksMutex(true,"HooksList");
|
static Mutex s_hooksMutex(true,"HooksList");
|
||||||
static ObjList s_hooks;
|
static ObjList s_hooks;
|
||||||
static NamedCounter* s_counter = 0;
|
static NamedCounter* s_counter = 0;
|
||||||
|
static NamedCounter* s_workCnt = 0;
|
||||||
|
|
||||||
const TokenDict Engine::s_callAccept[] = {
|
const TokenDict Engine::s_callAccept[] = {
|
||||||
{"accept", Engine::Accept},
|
{"accept", Engine::Accept},
|
||||||
|
@ -836,6 +837,7 @@ bool EngineHelp::received(Message &msg)
|
||||||
|
|
||||||
void EnginePrivate::run()
|
void EnginePrivate::run()
|
||||||
{
|
{
|
||||||
|
setCurrentObjCounter(s_workCnt);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
s_makeworker = false;
|
s_makeworker = false;
|
||||||
Engine::self()->m_dispatcher.dequeue();
|
Engine::self()->m_dispatcher.dequeue();
|
||||||
|
@ -876,6 +878,7 @@ static int engineRun(EngineLoop loop = 0)
|
||||||
s_startMsg.trimSpaces();
|
s_startMsg.trimSpaces();
|
||||||
Output("%s",s_startMsg.c_str());
|
Output("%s",s_startMsg.c_str());
|
||||||
Thread::setCurrentObjCounter((s_counter = GenObject::getObjCounter("engine")));
|
Thread::setCurrentObjCounter((s_counter = GenObject::getObjCounter("engine")));
|
||||||
|
s_workCnt = GenObject::getObjCounter("workers");
|
||||||
int retcode = Engine::self()->engineInit();
|
int retcode = Engine::self()->engineInit();
|
||||||
if (!retcode)
|
if (!retcode)
|
||||||
retcode = (loop ? loop() : Engine::self()->run());
|
retcode = (loop ? loop() : Engine::self()->run());
|
||||||
|
|
Loading…
Reference in New Issue