Commit Diff
- Commit:
0b3936e0d1faf40aca2dcb9951b9df8c83d9824e
- From:
- Mark Jamsek <mark@jamsek.dev>
- 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 @@ -4021,6 +4021,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) {