Skip to content

Commit

Permalink
Small fixes to EFS restore code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 40b6cd7 commit 0689422
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/lib/cbuf.c
Expand Up @@ -85,13 +85,13 @@ int circbuf::enqueue(void *data)
m_size++;
m_next_in %= m_capacity;

pthread_mutex_unlock(&m_lock);

/*
* Let a waiting consumer know there is data.
*/
pthread_cond_signal(&m_notempty);

pthread_mutex_unlock(&m_lock);

return 0;
}

Expand Down Expand Up @@ -127,13 +127,13 @@ void *circbuf::dequeue()
m_size--;
m_next_out %= m_capacity;

pthread_mutex_unlock(&m_lock);

/*
* Let a waiting producer know there is room.
*/
pthread_cond_signal(&m_notfull);

pthread_mutex_unlock(&m_lock);

return data;
}

Expand Down Expand Up @@ -171,12 +171,12 @@ int circbuf::flush()

m_flush = true;

pthread_mutex_unlock(&m_lock);

/*
* Let a waiting consumer know there will be no more data.
*/
pthread_cond_signal(&m_notempty);

pthread_mutex_unlock(&m_lock);

return 0;
}
4 changes: 2 additions & 2 deletions src/win32/findlib/win32.c
Expand Up @@ -622,7 +622,7 @@ static inline bool setup_copy_thread(JCR *jcr, BFILE *bfd)
new_context->flushed = false;
new_context->cb = New(circbuf);

nr_save_elements = jcr->cp_thread->cb->capacity();
nr_save_elements = new_context->cb->capacity();
new_context->save_data = (CP_THREAD_SAVE_DATA *)malloc(nr_save_elements * sizeof(CP_THREAD_SAVE_DATA));
memset(new_context->save_data, 0, nr_save_elements * sizeof(CP_THREAD_SAVE_DATA));
new_context->nr_save_elements = nr_save_elements;
Expand All @@ -636,7 +636,7 @@ static inline bool setup_copy_thread(JCR *jcr, BFILE *bfd)
goto bail_out;
}

if (pthread_create(&jcr->cp_thread->thread_id, NULL, copy_thread, (void *)jcr->cp_thread) != 0) {
if (pthread_create(&new_context->thread_id, NULL, copy_thread, (void *)new_context) != 0) {
pthread_cond_destroy(&new_context->start);
pthread_mutex_destroy(&new_context->lock);
goto bail_out;
Expand Down

0 comments on commit 0689422

Please sign in to comment.