Created
April 12, 2011 13:58
-
-
Save eferm/915530 to your computer and use it in GitHub Desktop.
Revisions
-
eferm revised this gist
Apr 12, 2011 . 1 changed file with 17 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,21 @@ 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; } -
eferm created this gist
Apr 12, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ 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;