提交 e77fb43b 编写于 作者: A alanb

6824135: (ch) test/java/nio/channels/AsyncCloseAndInterrupt.java fails (lnx)

Reviewed-by: sherman
上级 7082d981
...@@ -128,9 +128,10 @@ public class FileChannelImpl ...@@ -128,9 +128,10 @@ public class FileChannelImpl
throw new NonReadableChannelException(); throw new NonReadableChannelException();
synchronized (positionLock) { synchronized (positionLock) {
int n = 0; int n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return 0; return 0;
do { do {
...@@ -151,9 +152,10 @@ public class FileChannelImpl ...@@ -151,9 +152,10 @@ public class FileChannelImpl
throw new NonReadableChannelException(); throw new NonReadableChannelException();
synchronized (positionLock) { synchronized (positionLock) {
long n = 0; long n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return 0; return 0;
do { do {
...@@ -183,9 +185,10 @@ public class FileChannelImpl ...@@ -183,9 +185,10 @@ public class FileChannelImpl
throw new NonWritableChannelException(); throw new NonWritableChannelException();
synchronized (positionLock) { synchronized (positionLock) {
int n = 0; int n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return 0; return 0;
do { do {
...@@ -206,9 +209,10 @@ public class FileChannelImpl ...@@ -206,9 +209,10 @@ public class FileChannelImpl
throw new NonWritableChannelException(); throw new NonWritableChannelException();
synchronized (positionLock) { synchronized (positionLock) {
long n = 0; long n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return 0; return 0;
do { do {
...@@ -239,9 +243,10 @@ public class FileChannelImpl ...@@ -239,9 +243,10 @@ public class FileChannelImpl
ensureOpen(); ensureOpen();
synchronized (positionLock) { synchronized (positionLock) {
long p = -1; long p = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return 0; return 0;
do { do {
...@@ -262,9 +267,10 @@ public class FileChannelImpl ...@@ -262,9 +267,10 @@ public class FileChannelImpl
throw new IllegalArgumentException(); throw new IllegalArgumentException();
synchronized (positionLock) { synchronized (positionLock) {
long p = -1; long p = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return null; return null;
do { do {
...@@ -283,9 +289,10 @@ public class FileChannelImpl ...@@ -283,9 +289,10 @@ public class FileChannelImpl
ensureOpen(); ensureOpen();
synchronized (positionLock) { synchronized (positionLock) {
long s = -1; long s = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return -1; return -1;
do { do {
...@@ -311,9 +318,10 @@ public class FileChannelImpl ...@@ -311,9 +318,10 @@ public class FileChannelImpl
synchronized (positionLock) { synchronized (positionLock) {
int rv = -1; int rv = -1;
long p = -1; long p = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return null; return null;
...@@ -350,9 +358,10 @@ public class FileChannelImpl ...@@ -350,9 +358,10 @@ public class FileChannelImpl
public void force(boolean metaData) throws IOException { public void force(boolean metaData) throws IOException {
ensureOpen(); ensureOpen();
int rv = -1; int rv = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return; return;
do { do {
...@@ -406,9 +415,10 @@ public class FileChannelImpl ...@@ -406,9 +415,10 @@ public class FileChannelImpl
return IOStatus.UNSUPPORTED; return IOStatus.UNSUPPORTED;
long n = -1; long n = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return -1; return -1;
do { do {
...@@ -612,9 +622,10 @@ public class FileChannelImpl ...@@ -612,9 +622,10 @@ public class FileChannelImpl
throw new NonReadableChannelException(); throw new NonReadableChannelException();
ensureOpen(); ensureOpen();
int n = 0; int n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return -1; return -1;
do { do {
...@@ -637,9 +648,10 @@ public class FileChannelImpl ...@@ -637,9 +648,10 @@ public class FileChannelImpl
throw new NonWritableChannelException(); throw new NonWritableChannelException();
ensureOpen(); ensureOpen();
int n = 0; int n = 0;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return -1; return -1;
do { do {
...@@ -731,9 +743,10 @@ public class FileChannelImpl ...@@ -731,9 +743,10 @@ public class FileChannelImpl
throw new NonReadableChannelException(); throw new NonReadableChannelException();
long addr = -1; long addr = -1;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return null; return null;
if (size() < position + size) { // Extend file size if (size() < position + size) { // Extend file size
...@@ -900,9 +913,10 @@ public class FileChannelImpl ...@@ -900,9 +913,10 @@ public class FileChannelImpl
FileLockTable flt = fileLockTable(); FileLockTable flt = fileLockTable();
flt.add(fli); flt.add(fli);
boolean i = true; boolean i = true;
int ti = threads.add(); int ti = -1;
try { try {
begin(); begin();
ti = threads.add();
if (!isOpen()) if (!isOpen())
return null; return null;
int result = nd.lock(fd, true, position, size, shared); int result = nd.lock(fd, true, position, size, shared);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
/* @test /* @test
* @bug 4460583 4470470 4840199 6419424 6710579 6596323 * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135
* @summary Comprehensive test of asynchronous closing and interruption * @summary Comprehensive test of asynchronous closing and interruption
* @author Mark Reinhold * @author Mark Reinhold
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册