Skip to content

Commit

Permalink
Add IsVirtualThread to JNINativeInterface_
Browse files Browse the repository at this point in the history
This was added as a 'preview' API for JNI 19
  • Loading branch information
rib committed Sep 1, 2023
1 parent aa914ab commit 1353136
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `JNI_VERSION_9`, `JNI_VERSION_10`, `JNI_VERSION_19`, `JNI_VERSION_20` and `JNI_VERSION_21` constants
- GetModule was added to `JNINativeInterface` ([#22](https://github.com/jni-rs/jni-sys/pull/22))
- IsVirtualThread was added to `JNINativeInterface` ([#32](https://github.com/jni-rs/jni-sys/pull/32))

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,9 @@ pub struct JNINativeInterface_ {
unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jobjectRefType,
#[jni_added("9")]
pub GetModule: unsafe extern "system" fn(env: *mut JNIEnv, clazz: jclass) -> jobject,

#[jni_added("19")]
pub IsVirtualThread: unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jboolean,
}

#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion tests/jni-to-union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn jni_to_union() {
);
}

const NUM_JNI_ENV_MEMBERS: usize = 234;
const NUM_JNI_ENV_MEMBERS: usize = 235;
#[test]
fn jni_env_union() {
assert_eq!(
Expand Down

0 comments on commit 1353136

Please sign in to comment.