]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: POSIX mq: avoid double calls to ipc_mutex_unlock
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 30 Apr 2021 08:30:21 +0000 (10:30 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 30 Apr 2021 08:30:21 +0000 (10:30 +0200)
_mq_send as well as _mq_receive call ipc_mutex_unlock twice in case
of success, after having introduced __try/__except blocks.

Fixes: 3f3bd10104550 ("* Throughout, use __try/__except/__endtry blocks, rather than myfault handler.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/posix_ipc.cc

index c6a003c37af90296dd94513fa0199c8eb123fa7d..89ec7dbeff7a30268e67618adf1641167f04bb8e 100644 (file)
@@ -886,7 +886,6 @@ _mq_send (mqd_t mqd, const char *ptr, size_t len, unsigned int prio,
        ipc_cond_signal (mqinfo->mqi_waitrecv);
       attr->mq_curmsgs++;
 
-      ipc_mutex_unlock (mqinfo->mqi_lock);
       ret = 0;
     }
   __except (EBADF) {}
@@ -986,8 +985,6 @@ _mq_receive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop,
       if (attr->mq_curmsgs == attr->mq_maxmsg)
        ipc_cond_signal (mqinfo->mqi_waitsend);
       attr->mq_curmsgs--;
-
-      ipc_mutex_unlock (mqinfo->mqi_lock);
     }
   __except (EBADF) {}
   __endtry
This page took 0.034357 seconds and 5 git commands to generate.