Skip to content

Commit

Permalink
add possibly missing unlock, related to #17
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsegev committed Sep 30, 2023
1 parent b65e606 commit a82f489
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fio-stl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15949,8 +15949,10 @@ SFUNC int fio_queue_workers_add(fio_queue_s *q, size_t workers) {
q->consumers = FIO_LIST_INIT(q->consumers);
}
fio___thread_group_s grp = {.queue = q, .workers = workers, .stop = 1};
if (fio_thread_create(&grp.thread, fio___queue_worker_manager, &grp))
if (fio_thread_create(&grp.thread, fio___queue_worker_manager, &grp)) {
FIO___LOCK_UNLOCK(q->lock);
return -1;
}
while (grp.stop)
FIO_THREAD_RESCHEDULE();
FIO___LOCK_UNLOCK(q->lock);
Expand Down
4 changes: 3 additions & 1 deletion fio-stl/102 queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,10 @@ SFUNC int fio_queue_workers_add(fio_queue_s *q, size_t workers) {
q->consumers = FIO_LIST_INIT(q->consumers);
}
fio___thread_group_s grp = {.queue = q, .workers = workers, .stop = 1};
if (fio_thread_create(&grp.thread, fio___queue_worker_manager, &grp))
if (fio_thread_create(&grp.thread, fio___queue_worker_manager, &grp)) {
FIO___LOCK_UNLOCK(q->lock);
return -1;
}
while (grp.stop)
FIO_THREAD_RESCHEDULE();
FIO___LOCK_UNLOCK(q->lock);
Expand Down

0 comments on commit a82f489

Please sign in to comment.