Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-09-30 Thread Stuart Marks
On Thu, 11 Aug 2022 10:35:55 GMT, Daniel Fuchs  wrote:

>> Stuart Marks has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Revise Implementation Note discussing JNI Invocation API.
>
> src/java.base/share/classes/java/lang/Runtime.java line 197:
> 
>> 195:  * as possible. They should also not rely blindly upon services 
>> that may
>> 196:  * have registered their own shutdown hooks and therefore may 
>> themselves in
>> 197:  * the process of shutting down. Attempts to use other thread-based
> 
> Is there a "be" missing here? 
>> may themselves *be* in the process ...

Yes, "be" is missing. Hm, I hadn't edited that text... Ha that typo was 
introduced by MR in 1999! OK, fixed.

-

PR: https://git.openjdk.org/jdk/pull/9437


Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-08-14 Thread David Holmes
On Thu, 11 Aug 2022 06:49:20 GMT, David Holmes  wrote:

>> Stuart Marks has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Revise Implementation Note discussing JNI Invocation API.
>
> src/java.base/share/classes/java/lang/Runtime.java line 99:
> 
>> 97:  * JNI Invocation 
>> API
>> 98:  * to control launching and termination of the JVM. Such native code 
>> invokes the
>> 99:  * > href="{@docRoot}/../specs/jni/invocation.html#jni_createjavavm">{@code 
>> JNI_CreateJavaVM}
> 
> JNI {@code CreateJavaVM}

Sorry that is a wrong comment from me. The API is not symmetric - it is 
`JNI_CreateJavaVM` but just `DestroyJavaVM`.

> src/java.base/share/classes/java/lang/Runtime.java line 101:
> 
>> 99:  * > href="{@docRoot}/../specs/jni/invocation.html#jni_createjavavm">{@code 
>> JNI_CreateJavaVM}
>> 100:  * function to launch the JVM. Subsequently, the native code invokes the
>> 101:  * > href="{@docRoot}/../specs/jni/invocation.html#destroyjavavm">{@code 
>> DestroyJavaVM}
> 
> JNI {@code DestroyJavaVM}
> 
> to be consistent; or drop JNI from both.

Please ignore this comment too.

-

PR: https://git.openjdk.org/jdk/pull/9437


Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-08-11 Thread Daniel Fuchs
On Thu, 11 Aug 2022 04:00:39 GMT, Stuart Marks  wrote:

>> The concept of the shutdown sequence needs to be specified more clearly. 
>> This PR adds text for this into the class specification of 
>> `java.lang.Runtime`. Also includes adjustments to related areas in 
>> `addShutdownHook`, `halt`, and in the `System` and `Thread` classes. The 
>> changes here should coordinate with similar changes to JLS 12.8, JVMS 5.7, 
>> and the Invocation API chapter of the _JNI Specification._
>
> Stuart Marks has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Revise Implementation Note discussing JNI Invocation API.

src/java.base/share/classes/java/lang/Runtime.java line 197:

> 195:  * as possible. They should also not rely blindly upon services that 
> may
> 196:  * have registered their own shutdown hooks and therefore may 
> themselves in
> 197:  * the process of shutting down. Attempts to use other thread-based

Is there a "be" missing here? 
> may themselves *be* in the process ...

-

PR: https://git.openjdk.org/jdk/pull/9437


Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-08-11 Thread David Holmes
On Thu, 11 Aug 2022 04:00:39 GMT, Stuart Marks  wrote:

>> The concept of the shutdown sequence needs to be specified more clearly. 
>> This PR adds text for this into the class specification of 
>> `java.lang.Runtime`. Also includes adjustments to related areas in 
>> `addShutdownHook`, `halt`, and in the `System` and `Thread` classes. The 
>> changes here should coordinate with similar changes to JLS 12.8, JVMS 5.7, 
>> and the Invocation API chapter of the _JNI Specification._
>
> Stuart Marks has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Revise Implementation Note discussing JNI Invocation API.

src/java.base/share/classes/java/lang/Runtime.java line 99:

> 97:  * JNI Invocation 
> API
> 98:  * to control launching and termination of the JVM. Such native code 
> invokes the
> 99:  *  href="{@docRoot}/../specs/jni/invocation.html#jni_createjavavm">{@code 
> JNI_CreateJavaVM}

JNI {@code CreateJavaVM}

src/java.base/share/classes/java/lang/Runtime.java line 101:

> 99:  *  href="{@docRoot}/../specs/jni/invocation.html#jni_createjavavm">{@code 
> JNI_CreateJavaVM}
> 100:  * function to launch the JVM. Subsequently, the native code invokes the
> 101:  *  href="{@docRoot}/../specs/jni/invocation.html#destroyjavavm">{@code 
> DestroyJavaVM}

JNI {@code DestroyJavaVM}

to be consistent; or drop JNI from both.

src/java.base/share/classes/java/lang/Runtime.java line 103:

> 101:  *  href="{@docRoot}/../specs/jni/invocation.html#destroyjavavm">{@code 
> DestroyJavaVM}
> 102:  * function to await termination of that JVM. The {@code DestroyJavaVM} 
> function is responsible for
> 103:  * initiating the shutdown sequence when the number of {@linkplain 
> Thread#isAlive() running}

s/running/live

"live" is consistent with Thread terminology

src/java.base/share/classes/java/lang/Runtime.java line 107:

> 105:  * terminates, control is returned to the native code that invoked 
> {@code DestroyJavaVM}.
> 106:  * 
> 107:  * This differs from the {@link #exit exit} or {@link #halt halt} 
> methods. These methods typically

In a new paragraph it is not clear what "This" refers to. I would run this into 
the previous paragraph as:

> This behavior differs from the {@link #exit exit} or {@link #halt halt} 
> methods, which typically terminate the OS process hosting the JVM and do not 
> interact with the JNI Invocation API.

-

PR: https://git.openjdk.org/jdk/pull/9437


Re: RFR: 8290036: Define and specify Runtime shutdown sequence [v6]

2022-08-10 Thread Stuart Marks
> The concept of the shutdown sequence needs to be specified more clearly. This 
> PR adds text for this into the class specification of `java.lang.Runtime`. 
> Also includes adjustments to related areas in `addShutdownHook`, `halt`, and 
> in the `System` and `Thread` classes. The changes here should coordinate with 
> similar changes to JLS 12.8, JVMS 5.7, and the Invocation API chapter of the 
> _JNI Specification._

Stuart Marks has updated the pull request incrementally with one additional 
commit since the last revision:

  Revise Implementation Note discussing JNI Invocation API.

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/9437/files
  - new: https://git.openjdk.org/jdk/pull/9437/files/c8b331f1..783b3b59

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9437&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9437&range=04-05

  Stats: 13 lines in 1 file changed: 5 ins; 0 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/9437.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9437/head:pull/9437

PR: https://git.openjdk.org/jdk/pull/9437