Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LandryNorris committed Jul 12, 2022
1 parent bef86d0 commit 92e69ec
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ import platform.android.JNIEnvVar
import platform.android.JNINativeMethod
import platform.android.jobject

/**
* Enter the monitor owned by obj
*
* Do not mix JNI [monitorExit] with Java synchronized method
*/
fun CPointer<JNIEnvVar>.monitorEnter(obj: jobject) {
val method = pointed.pointed?.MonitorEnter ?: error("JNI is not Oracle standard")
method.invoke(this, obj)
}

/**
* The current thread must be the owner of the monitor associated with obj.
*
* Do not mix JNI [monitorExit] with Java synchronized method
*/
fun CPointer<JNIEnvVar>.monitorExit(obj: jobject) {
val method = pointed.pointed?.MonitorExit ?: error("JNI is not Oracle standard")
method.invoke(this, obj)
Expand Down

0 comments on commit 92e69ec

Please sign in to comment.