Commit Diff
- Commit:
fba1c01f5ad1c8c5973200213fc44273a8ea3e78
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
- Message:
- tog: fix log view race condition evinced by regress When the commit graph has been traversed, we set the log_complete flag to signal the main thread that we've completed iterating commit history, which request_log_commits() checks and, if set, returns early instead of calling trigger_log_thread(). If called, trigger_log_thread() wakes the log thread, then waits on the log thread to unblock when another commit has been loaded. There's a race between the log thread setting the log_complete flag and request_log_commits() checking it, which causes trigger_load_thread() to wait on a signal that never unblocks because there are no more commits to be loaded. ok stsp@
- Actions:
- Patch | Tree
--- tog/tog.c +++ tog/tog.c @@ -4025,6 +4025,8 @@ log_thread(void *arg) TAILQ_FIRST(&a->real_commits->head); *a->selected_entry = *a->first_displayed_entry; } + if (done) + a->log_complete = 1; errcode = pthread_cond_signal(&a->commit_loaded); if (errcode) {