diff --git a/3rdparty/cpprestsdk/src/pplx/threadpool.cpp b/3rdparty/cpprestsdk/src/pplx/threadpool.cpp deleted file mode 100644 index 8b5d9bd191a0450d6b50cf78da3a493937832b16..0000000000000000000000000000000000000000 --- a/3rdparty/cpprestsdk/src/pplx/threadpool.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*** -* ==++== -* -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -* ==--== -* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ -**/ -#include "stdafx.h" - -#if defined(__ANDROID__) -#include -#include -#endif - -namespace crossplat -{ -#if (defined(ANDROID) || defined(__ANDROID__)) -// This pointer will be 0-initialized by default (at load time). -std::atomic JVM; - -static void abort_if_no_jvm() -{ - if (JVM == nullptr) - { - __android_log_print(ANDROID_LOG_ERROR, "CPPRESTSDK", "%s", "The CppREST SDK must be initialized before first use on android: https://casablanca.codeplex.com/wikipage?title=Use%20on%20Android"); - std::abort(); - } -} - -JNIEnv* get_jvm_env() -{ - abort_if_no_jvm(); - JNIEnv* env = nullptr; - auto result = JVM.load()->AttachCurrentThread(&env, nullptr); - if (result != JNI_OK) - { - throw std::runtime_error("Could not attach to JVM"); - } - - return env; -} - -threadpool& threadpool::shared_instance() -{ - abort_if_no_jvm(); - static threadpool s_shared(40); - return s_shared; -} - -#else - -// initialize the static shared threadpool -threadpool& threadpool::shared_instance() -{ - static threadpool s_shared(40); - return s_shared; -} - -#endif - -} - -#if defined(__ANDROID__) -void cpprest_init(JavaVM* vm) { - crossplat::JVM = vm; -} -#endif -