diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-09-01 10:04:05 -0700 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-09-01 10:27:52 -0700 |
commit | 4a893f72cadaa875a920db8949171b002f656e43 (patch) | |
tree | 1e08a3cb6f579cab9c3c9a138d36ababdf76121b /src/Task.cc | |
parent | 56d91ddd2cd42b782cde0bb3fdf4eb9ebe7597be (diff) | |
parent | 06674e57649d536cf19715524ee40c5ad4a9026d (diff) |
Merge commit '06674e57649d536cf19715524ee40c5ad4a9026d'
Conflicts:
includes/LuaTask.h
includes/TaskMan.h
includes/Threads.h
src/TaskMan.cc
src/Threads.cc
Diffstat (limited to 'src/Task.cc')
-rw-r--r-- | src/Task.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Task.cc b/src/Task.cc index df8eee2..4465203 100644 --- a/src/Task.cc +++ b/src/Task.cc @@ -37,7 +37,7 @@ void Balau::Task::setup(TaskMan * taskMan, void * stack) { m_taskMan = taskMan; - m_tls = g_tlsManager->createTLS(); + m_tls = Local::createTLS(); void * oldTLS = g_tlsManager->getTLS(); g_tlsManager->setTLS(m_tls); localTask.set(this); @@ -310,9 +310,9 @@ void Balau::QueueBase::iPush(void * t, Events::Async * event) { pthread_cond_signal(&m_cond); } -void * Balau::QueueBase::iPop(Events::Async * event) { - m_lock.enter(); - while (!m_front) { +void * Balau::QueueBase::iPop(Events::Async * event, bool wait) { + ScopeLock sl(m_lock); + while (!m_front && wait) { if (event) { Task::prepare(event); m_lock.leave(); @@ -332,6 +332,5 @@ void * Balau::QueueBase::iPop(Events::Async * event) { m_back = NULL; void * t = c->m_elem; delete c; - m_lock.leave(); return t; } |