Skip to content

Commit

Permalink
Update threaded_callback_invokation.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmikov committed May 26, 2014
1 parent 6299644 commit 72c1e8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/threaded_callback_invokation.cc
Expand Up @@ -6,12 +6,12 @@ ThreadedCallbackInvokation::ThreadedCallbackInvokation(callback_info *cbinfo, vo
m_parameters = parameters;

pthread_mutex_init(&m_mutex, NULL);
pthread_mutex_lock(&m_mutex);
// pthread_mutex_lock(&m_mutex);
pthread_cond_init(&m_cond, NULL);
}

ThreadedCallbackInvokation::~ThreadedCallbackInvokation() {
pthread_mutex_unlock(&m_mutex);
// pthread_mutex_unlock(&m_mutex);
pthread_cond_destroy(&m_cond);
pthread_mutex_destroy(&m_mutex);
}
Expand All @@ -23,5 +23,7 @@ void ThreadedCallbackInvokation::SignalDoneExecuting() {
}

void ThreadedCallbackInvokation::WaitForExecution() {
pthread_mutex_lock(&m_mutex);
pthread_cond_wait(&m_cond, &m_mutex);
pthread_mutex_unlock(&m_mutex);
}

0 comments on commit 72c1e8e

Please sign in to comment.