X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6..67d66b0cf79b9fc02c0450f254584693dbf21d3b:/src/bindings/java/JavaContext.cpp diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index ff993551c4..48e1da96e2 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -1,6 +1,6 @@ /* Context switching within the JVM. */ -/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -8,7 +8,6 @@ #include "JavaContext.hpp" #include "jxbt_utilities.hpp" #include "simgrid/Exception.hpp" -#include "src/simix/smx_private.hpp" #include #include @@ -56,8 +55,8 @@ void JavaContext::start_hook() //Attach the thread to the JVM JNIEnv *env; - XBT_ATTRIB_UNUSED jint error = __java_vm->AttachCurrentThread((void**)&env, nullptr); - xbt_assert((error == JNI_OK), "The thread could not be attached to the JVM"); + xbt_assert(__java_vm->AttachCurrentThread((void**)&env, nullptr) == JNI_OK, + "The thread could not be attached to the JVM"); this->jenv_ = env; } @@ -65,7 +64,7 @@ void JavaContext::stop_hook() { JNIEnv* env = this->jenv_; env->DeleteGlobalRef(this->jprocess_); - XBT_ATTRIB_UNUSED jint error = __java_vm->DetachCurrentThread(); + jint error = __java_vm->DetachCurrentThread(); if (error != JNI_OK) { /* This is probably a Java thread, ie an actor not created from the XML (and thus from the C++), * but from Java with something like new Process().start().