8032901: WaitForMultipleObjects() return value not handled appropriately
authoraefimov
Wed, 04 Jun 2014 16:26:11 +0400
changeset 24706 c825cd1299e4
parent 24705 38b2b35140e8
child 24707 f1225d0f947c
8032901: WaitForMultipleObjects() return value not handled appropriately Reviewed-by: dholmes, sla
jdk/src/windows/transport/shmem/shmem_md.c
--- a/jdk/src/windows/transport/shmem/shmem_md.c	Mon Jun 02 17:59:08 2014 +0200
+++ b/jdk/src/windows/transport/shmem/shmem_md.c	Wed Jun 04 16:26:11 2014 +0400
@@ -200,6 +200,17 @@
     rc = WaitForMultipleObjects(count, handles,
                                 FALSE,              /* wait for either, not both */
                                 INFINITE);          /* infinite timeout */
+
+    /* If the mutex is abandoned we will consider this a fatal error
+     * and abort with appropriate message.
+     *
+     * Note that only mutexes can be abandoned and that our mutex is
+     * always at position 0 in the handles array. Thus we only need
+     * to check WAIT_ABANDONED_0 (not WAIT_ABANDONED_0 + x).
+     */
+    if (rc == WAIT_ABANDONED_0) {
+        exitTransportWithError("Observed abandoned IP mutex. Aborting.",THIS_FILE, __DATE__, __LINE__);
+    }
     return (rc == WAIT_OBJECT_0) ? SYS_OK : SYS_ERR;
 }