commit - 5e756114a5ceef5332d048878ca856fd878cb9c2
commit + 7aafa0d11a8f22f82c826f4c7890174d3d7fa381
blob - 64e4bd077d23c48891fd59e49a7349a55f9cb238
blob + 22c411be2ca720ffc0fbf2e05fdfd3f3cd81ef0a
--- tog/tog.c
+++ tog/tog.c
if (*last_displayed_entry == NULL)
return NULL;
-
- do {
- pentry = TAILQ_NEXT(*last_displayed_entry, entry);
- if (pentry == NULL && !*log_complete) {
- (*commits_needed)++;
- if (nscrolled == 0) {
- /* Redraw screen for "loading..." message. */
- err = show_log_view(view);
- if (err)
- return err;
- update_panels();
- doupdate();
- }
+ pentry = TAILQ_NEXT(*last_displayed_entry, entry);
+ if (pentry == NULL && !*log_complete) {
+ int errcode;
+ if (*commits_needed > 0)
+ return NULL;
+ (*commits_needed) = maxscroll;
+ errcode = pthread_cond_signal(need_commits);
+ if (errcode)
+ return got_error_set_errno(errcode);
+ errcode = pthread_mutex_unlock(&tog_mutex);
+ if (errcode)
+ return got_error_set_errno(errcode);
+ pthread_yield();
+ errcode = pthread_mutex_lock(&tog_mutex);
+ if (errcode)
+ return got_error_set_errno(errcode);
+ if (*commits_needed > 0) {
+ /* Thread is not done yet; lose a key press
+ * and let the user retry... */
+ return NULL;
+ }
+ }
- while (*commits_needed > 0) {
- int errcode;
- errcode = pthread_cond_signal(need_commits);
- if (errcode)
- return got_error_set_errno(errcode);
- errcode = pthread_mutex_unlock(&tog_mutex);
- if (errcode)
- return got_error_set_errno(errcode);
- pthread_yield();
- errcode = pthread_mutex_lock(&tog_mutex);
- if (errcode)
- return got_error_set_errno(errcode);
- }
- }
+ do {
pentry = TAILQ_NEXT(*last_displayed_entry, entry);
if (pentry == NULL)
break;