Пример #1
0
 GuardUnsafeAccess(JavaThread* thread, jobject _obj) : _thread(thread) {
   if (JNIHandles::resolve(_obj) == NULL) {
     // native/off-heap access which may raise SIGBUS if accessing
     // memory mapped file data in a region of the file which has
     // been truncated and is now invalid
     _thread->set_doing_unsafe_access(true);
     _active = true;
   } else {
     _active = false;
   }
 }
Пример #2
0
 ~GuardUnsafeAccess() {
   if (_active) {
     _thread->set_doing_unsafe_access(false);
   }
 }