pastebin - collaborative debugging tool
rovema.kpaste.net RSS


libtirpc: Switch condition variable from signal to broadcast, to see whether it fixes hangs
Posted by Anonymous on Sat 28th Oct 2023 10:51
raw | new post

  1. diff --git a/libtirpc/src/clnt_dg.c b/libtirpc/src/clnt_dg.c
  2. index 529a401..2753510 100644
  3. --- a/libtirpc/src/clnt_dg.c
  4. +++ b/libtirpc/src/clnt_dg.c
  5. @@ -110,7 +110,7 @@ static cond_t       *dg_cv;
  6.         dg_fd_locks[(fd)] = 0;          \
  7.         mutex_unlock(&clnt_fd_lock);    \
  8.         \
  9. -       cond_signal(&dg_cv[(fd)]);      \
  10. +       cond_broadcast(&dg_cv[(fd)]);   \
  11.  }
  12.  #endif
  13.  
  14. @@ -612,7 +612,7 @@ clnt_dg_freeres(cl, xdr_res, res_ptr)
  15.         dummy = (*xdr_res)(xdrs, res_ptr);
  16.         mutex_unlock(&clnt_fd_lock);
  17.  //     thr_sigsetmask(SIG_SETMASK, &mask, NULL);
  18. -       cond_signal(&dg_cv[cu->cu_fd]);
  19. +       cond_broadcast(&dg_cv[cu->cu_fd]);
  20.         return (dummy);
  21.  }
  22.  
  23. @@ -803,7 +803,7 @@ clnt_dg_destroy(cl)
  24.         mem_free(cl, sizeof (CLIENT));
  25.         mutex_unlock(&clnt_fd_lock);
  26.  //     thr_sigsetmask(SIG_SETMASK, &mask, NULL);
  27. -       cond_signal(&dg_cv[cu_fd]);
  28. +       cond_broadcast(&dg_cv[cu_fd]);
  29.  }
  30.  
  31.  static struct clnt_ops *
  32. diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c
  33. index e0a9d30..1fcec9c 100644
  34. --- a/libtirpc/src/clnt_vc.c
  35. +++ b/libtirpc/src/clnt_vc.c
  36. @@ -748,7 +748,7 @@ clnt_vc_freeres(cl, xdr_res, res_ptr)
  37.         dummy = (*xdr_res)(xdrs, res_ptr);
  38.         mutex_unlock(&clnt_fd_lock);
  39.  //     thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
  40. -       cond_signal(&vc_cv[ct->ct_fd]);
  41. +       cond_broadcast(&vc_cv[ct->ct_fd]);
  42.  
  43.         return dummy;
  44.  }
  45. @@ -923,7 +923,7 @@ clnt_vc_destroy(cl)
  46.              GetCurrentThreadId(), cl->cb_thread);
  47.          cl->shutdown = 1;
  48.          mutex_unlock(&clnt_fd_lock);
  49. -        cond_signal(&vc_cv[ct_fd]);
  50. +        cond_broadcast(&vc_cv[ct_fd]);
  51.          status = WaitForSingleObject(cl->cb_thread, INFINITE);
  52.          fprintf(stdout, "%04x: terminated callback thread\n", GetCurrentThreadId());
  53.          mutex_lock(&clnt_fd_lock);
  54. @@ -945,7 +945,7 @@ clnt_vc_destroy(cl)
  55.         mem_free(cl, sizeof(CLIENT));
  56.         mutex_unlock(&clnt_fd_lock);
  57.  //     thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
  58. -       cond_signal(&vc_cv[ct_fd]);
  59. +       cond_broadcast(&vc_cv[ct_fd]);
  60.  }
  61.  
  62.  /*

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at