diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 2650c35aca..c188b0ce21 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -224,7 +224,7 @@ mq_getattr (mqd_t mqd, struct mq_attr *mqstat) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -241,7 +241,7 @@ mq_setattr (mqd_t mqd, const struct mq_attr *mqstat, struct mq_attr *omqstat) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -258,7 +258,7 @@ mq_notify (mqd_t mqd, const struct sigevent *notification) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -276,7 +276,7 @@ mq_timedsend (mqd_t mqd, const char *ptr, size_t len, unsigned int prio, { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -300,7 +300,7 @@ mq_timedreceive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop, { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); diff --git a/winsup/cygwin/release/3.5.7 b/winsup/cygwin/release/3.5.7 index 12180efd9a..87baa3ada5 100644 --- a/winsup/cygwin/release/3.5.7 +++ b/winsup/cygwin/release/3.5.7 @@ -3,3 +3,7 @@ Fixes: - Fix stat() on message queues. Addresses: https://cygwin.com/pipermail/cygwin/2025-January/257186.html + +- Avoid deadlocks when calling message queue functions from different threads + in the same process. + Addresses: https://cygwin.com/pipermail/cygwin/2025-January/257120.html