Skip to content

Instantly share code, notes, and snippets.

@eferm
Created April 12, 2011 13:58
Show Gist options
  • Select an option

  • Save eferm/915530 to your computer and use it in GitHub Desktop.

Select an option

Save eferm/915530 to your computer and use it in GitHub Desktop.
persist_write
bool Persistence::persist_write(const char* key, size_t key_length,
const char* value, size_t value_length)
{
/* boring code removed */
write_job* job = new write_job;
bool finished = false;
job->buf = buf;
job->slot = job_slot;
job->finished = &finished;
enqueue_write_job(job);
boost::shared_lock<boost::shared_mutex> lock(write_mutex);
while (!finished) {
job_finish.wait(lock);
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment