Created
April 12, 2011 13:58
-
-
Save eferm/915530 to your computer and use it in GitHub Desktop.
persist_write
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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