changeset 7981:b5c3e9670fa0

8153641: assert(thread_state == _thread_in_native) failed: Assumed thread_in_native while heap dump Reviewed-by: dsamersoff, sspitsyn, sla
author aeriksso
date Thu, 21 Apr 2016 13:17:25 +0200
parents 65a0107d52ed
children 3e1cd663c2d3
files src/os/solaris/vm/os_solaris.cpp src/share/vm/services/heapDumper.cpp
diffstat 2 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/solaris/vm/os_solaris.cpp	Mon Mar 14 12:35:48 2016 +0300
+++ b/src/os/solaris/vm/os_solaris.cpp	Thu Apr 21 13:17:25 2016 +0200
@@ -6248,14 +6248,7 @@
 }
 
 size_t os::write(int fd, const void *buf, unsigned int nBytes) {
-  Thread* t = ThreadLocalStorage::thread();
-  if (t->is_Java_thread()) {
-    INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
-  } else {
-    size_t res;
-    RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
-    return res;
-  }
+  INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
 }
 
 int os::close(int fd) {
--- a/src/share/vm/services/heapDumper.cpp	Mon Mar 14 12:35:48 2016 +0300
+++ b/src/share/vm/services/heapDumper.cpp	Thu Apr 21 13:17:25 2016 +0200
@@ -468,7 +468,7 @@
   // flush and close dump file
   if (is_open()) {
     flush();
-    os::close(file_descriptor());
+    ::close(file_descriptor());
     set_file_descriptor(-1);
   }
 }
@@ -480,12 +480,11 @@
     ssize_t n = 0;
     while (len > 0) {
       uint tmp = (uint)MIN2(len, (size_t)UINT_MAX);
-      n = os::write(file_descriptor(), pos, tmp);
+      n = ::write(file_descriptor(), pos, tmp);
 
       if (n < 0) {
-        // EINTR cannot happen here, os::write will take care of that
         set_error(strerror(errno));
-        os::close(file_descriptor());
+        ::close(file_descriptor());
         set_file_descriptor(-1);
         return;
       }