Пример #1
0
            public static void MonitorExit(JniObjectReference instance)
            {
                int r = _MonitorExit(instance);

                if (r != 0)
                {
                    var e = JniEnvironment.GetExceptionForLastThrowable();
                    if (e != null)
                    {
                        ExceptionDispatchInfo.Capture(e).Throw();
                    }
                    throw new InvalidOperationException(string.Format("Could not exit monitor; JNIEnv::MonitorExit() returned {0}.", r));
                }
            }
            public static void PushLocalFrame(int capacity)
            {
                int r = _PushLocalFrame(capacity);

                if (r == 0)
                {
                    return;
                }

                var e = JniEnvironment.GetExceptionForLastThrowable();

                if (e != null)
                {
                    ExceptionDispatchInfo.Capture(e).Throw();
                }

                throw new InvalidOperationException(string.Format("Could not push a frame; JNIEnv::PushLocalFrame() returned {0}.", r));
            }