We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我在ndk中的Native函数中成功的调用jvm->AttachCurrentThread(主线程)。可以正常的调用java的clashh方法。 也能在std::thread线程中成功获取: std::thread nativeThread([B]() { // 将子线程附加到Java虚拟机上 JavaVM* pJvm = JniHelper::getJavaVM(); JNIEnv *envSub = nullptr; pJvm->AttachCurrentThread(&envSub, nullptr); 但是在http::Server().on_req(cb).start()中的cb函数中却无法获取,是协程不支持吗,无法获取线程ID造成的吗?
std::thread nativeThread([B]() { // 将子线程附加到Java虚拟机上 JavaVM* pJvm = JniHelper::getJavaVM(); JNIEnv *envSub = nullptr; pJvm->AttachCurrentThread(&envSub, nullptr);
The text was updated successfully, but these errors were encountered:
http::Server 内部可能有多个线程,cb 可能被多个线程调用
http::Server
Sorry, something went wrong.
那有没有解决方法啊?我实际上是把一个Http连接升级成了websocket。然后一直保持着连接(循环收发信息)。按理此时就只是一个线程来处理这个CB吧?有什么办法支持jvm->AttachCurrentThread吗?
No branches or pull requests
我在ndk中的Native函数中成功的调用jvm->AttachCurrentThread(主线程)。可以正常的调用java的clashh方法。
也能在std::thread线程中成功获取:
std::thread nativeThread([B]() { // 将子线程附加到Java虚拟机上 JavaVM* pJvm = JniHelper::getJavaVM(); JNIEnv *envSub = nullptr; pJvm->AttachCurrentThread(&envSub, nullptr);
但是在http::Server().on_req(cb).start()中的cb函数中却无法获取,是协程不支持吗,无法获取线程ID造成的吗?
The text was updated successfully, but these errors were encountered: