mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
Merge
This commit is contained in:
commit
ded94368d1
170 changed files with 3525 additions and 2243 deletions
|
@ -132,7 +132,7 @@ public class SubSystem {
|
|||
retval = Long.parseLong(strval);
|
||||
} catch (NumberFormatException e) {
|
||||
// For some properties (e.g. memory.limit_in_bytes) we may overflow the range of signed long.
|
||||
// In this case, return Long.max
|
||||
// In this case, return Long.MAX_VALUE
|
||||
BigInteger b = new BigInteger(strval);
|
||||
if (b.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
|
||||
return Long.MAX_VALUE;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -91,18 +91,22 @@ char *getMacOSXLocale(int cat) {
|
|||
|
||||
if (hyphenPos == NULL || // languageString contains ISO639 only, e.g., "en"
|
||||
languageString + langStrLen - hyphenPos == 5) { // ISO639-ScriptCode, e.g., "en-Latn"
|
||||
CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
|
||||
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding());
|
||||
char *underscorePos = strrchr(localeString, '_');
|
||||
char *region = NULL;
|
||||
CFLocaleRef cflocale = CFLocaleCopyCurrent();
|
||||
if (cflocale != NULL) {
|
||||
CFStringGetCString(CFLocaleGetIdentifier(cflocale),
|
||||
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding());
|
||||
char *underscorePos = strrchr(localeString, '_');
|
||||
char *region = NULL;
|
||||
|
||||
if (underscorePos != NULL) {
|
||||
region = underscorePos + 1;
|
||||
}
|
||||
if (underscorePos != NULL) {
|
||||
region = underscorePos + 1;
|
||||
}
|
||||
|
||||
if (region != NULL) {
|
||||
strcat(languageString, "-");
|
||||
strcat(languageString, region);
|
||||
if (region != NULL) {
|
||||
strcat(languageString, "-");
|
||||
strcat(languageString, region);
|
||||
}
|
||||
CFRelease(cflocale);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,12 +116,19 @@ char *getMacOSXLocale(int cat) {
|
|||
|
||||
default:
|
||||
{
|
||||
if (!CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
|
||||
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) {
|
||||
CFLocaleRef cflocale = CFLocaleCopyCurrent();
|
||||
if (cflocale != NULL) {
|
||||
if (!CFStringGetCString(CFLocaleGetIdentifier(cflocale),
|
||||
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) {
|
||||
CFRelease(cflocale);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retVal = localeString;
|
||||
CFRelease(cflocale);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retVal = localeString;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -317,7 +317,7 @@ class Iocp extends AsynchronousChannelGroupImpl {
|
|||
myGroupAndInvokeCount.resetInvokeCount();
|
||||
|
||||
// wait for I/O completion event
|
||||
// A error here is fatal (thread will not be replaced)
|
||||
// An error here is fatal (thread will not be replaced)
|
||||
replaceMe = false;
|
||||
try {
|
||||
getQueuedCompletionStatus(port, ioResult);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -143,7 +143,6 @@ class PendingIoCache {
|
|||
// simulate the failure of all pending I/O operations.
|
||||
for (Long ov: pendingIoMap.keySet()) {
|
||||
PendingFuture<?,?> result = pendingIoMap.get(ov);
|
||||
assert !result.isDone();
|
||||
|
||||
// make I/O port aware of the stale OVERLAPPED structure
|
||||
Iocp iocp = (Iocp)((Groupable)result.channel()).group();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -228,7 +228,6 @@ public class WindowsAsynchronousFileChannelImpl
|
|||
@Override
|
||||
public void run() {
|
||||
long overlapped = 0L;
|
||||
boolean pending = false;
|
||||
try {
|
||||
begin();
|
||||
|
||||
|
@ -242,7 +241,6 @@ public class WindowsAsynchronousFileChannelImpl
|
|||
overlapped);
|
||||
if (n == IOStatus.UNAVAILABLE) {
|
||||
// I/O is pending
|
||||
pending = true;
|
||||
return;
|
||||
}
|
||||
// acquired lock immediately
|
||||
|
@ -253,9 +251,9 @@ public class WindowsAsynchronousFileChannelImpl
|
|||
// lock failed or channel closed
|
||||
removeFromFileLockTable(fli);
|
||||
result.setFailure(toIOException(x));
|
||||
} finally {
|
||||
if (!pending && overlapped != 0L)
|
||||
if (overlapped != 0L)
|
||||
ioCache.remove(overlapped);
|
||||
} finally {
|
||||
end();
|
||||
}
|
||||
|
||||
|
@ -448,13 +446,12 @@ public class WindowsAsynchronousFileChannelImpl
|
|||
} catch (Throwable x) {
|
||||
// failed to initiate read
|
||||
result.setFailure(toIOException(x));
|
||||
if (overlapped != 0L)
|
||||
ioCache.remove(overlapped);
|
||||
} finally {
|
||||
if (!pending) {
|
||||
if (!pending)
|
||||
// release resources
|
||||
if (overlapped != 0L)
|
||||
ioCache.remove(overlapped);
|
||||
releaseBufferIfSubstituted();
|
||||
}
|
||||
end();
|
||||
}
|
||||
|
||||
|
@ -628,9 +625,9 @@ public class WindowsAsynchronousFileChannelImpl
|
|||
result.setFailure(toIOException(x));
|
||||
|
||||
// release resources
|
||||
releaseBufferIfSubstituted();
|
||||
if (overlapped != 0L)
|
||||
ioCache.remove(overlapped);
|
||||
releaseBufferIfSubstituted();
|
||||
|
||||
} finally {
|
||||
end();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -115,7 +115,7 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_lockFile(JNIEnv *env, jobject
|
|||
if (error == ERROR_IO_PENDING) {
|
||||
return IOS_UNAVAILABLE;
|
||||
}
|
||||
JNU_ThrowIOExceptionWithLastError(env, "WriteFile failed");
|
||||
JNU_ThrowIOExceptionWithLastError(env, "LockFile failed");
|
||||
return IOS_THROWN;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue