提交 ab431ef7 编写于 作者: A aeriksso

8153641: assert(thread_state == _thread_in_native) failed: Assumed thread_in_native while heap dump

Reviewed-by: dsamersoff, sspitsyn, sla
上级 4ebeac0e
...@@ -6248,14 +6248,7 @@ bool os::is_headless_jre() { ...@@ -6248,14 +6248,7 @@ bool os::is_headless_jre() {
} }
size_t os::write(int fd, const void *buf, unsigned int nBytes) { size_t os::write(int fd, const void *buf, unsigned int nBytes) {
Thread* t = ThreadLocalStorage::thread(); INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
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;
}
} }
int os::close(int fd) { int os::close(int fd) {
......
...@@ -468,7 +468,7 @@ void DumpWriter::close() { ...@@ -468,7 +468,7 @@ void DumpWriter::close() {
// flush and close dump file // flush and close dump file
if (is_open()) { if (is_open()) {
flush(); flush();
os::close(file_descriptor()); ::close(file_descriptor());
set_file_descriptor(-1); set_file_descriptor(-1);
} }
} }
...@@ -480,12 +480,11 @@ void DumpWriter::write_internal(void* s, size_t len) { ...@@ -480,12 +480,11 @@ void DumpWriter::write_internal(void* s, size_t len) {
ssize_t n = 0; ssize_t n = 0;
while (len > 0) { while (len > 0) {
uint tmp = (uint)MIN2(len, (size_t)UINT_MAX); 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) { if (n < 0) {
// EINTR cannot happen here, os::write will take care of that
set_error(strerror(errno)); set_error(strerror(errno));
os::close(file_descriptor()); ::close(file_descriptor());
set_file_descriptor(-1); set_file_descriptor(-1);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册