Skip to content

Commit dcf05ea

Browse files
committed
only use the condition variable
1 parent c005b23 commit dcf05ea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

keyvi/include/keyvi/index/internal/index_writer_worker.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,17 @@ std::cout << "flush" << std::endl;
211211
Compile(&payload);
212212
});
213213
} else {
214-
std::shared_mutex m;
215-
std::condition_variable_any c;
216-
std::shared_lock lock(m);
217-
compiler_active_object_([&m, &c](IndexPayload& payload) {
214+
std::mutex m;
215+
std::condition_variable c;
216+
std::unique_lock<std::mutex> lock(m);
217+
compiler_active_object_([&c](IndexPayload& payload) {
218218

219219
PersistDeletes(&payload);
220220
Compile(&payload);
221-
std::shared_lock waitLock(m);
221+
//std::unique_lock<std::mutex> waitLock(m);
222222
//waitLock.unlock();
223223
//lock.unlock();
224+
//waitLock.release();
224225
c.notify_all();
225226
std::cout << "compile done" << std::endl;
226227
});

0 commit comments

Comments
 (0)