| 62 | JavaThread::~JavaThread() = default; |
| 63 | |
| 64 | void jniNativeThreadEntryPoint(JNIEnv* /*env*/, jclass /*cls*/, jlong ptr) { |
| 65 | // Retain for the duration of handler(), mirroring threadEntryPoint() in Thread.cpp. |
| 66 | // Tearing down a ThreadedDispatchQueue from its own thread drops the owning Ref<Thread> |
| 67 | // mid-task; without this retain, ~Thread() destroys the still-executing runnable and its |
| 68 | // captured Ref<TaskQueue>, and TaskQueue::runNextTask then re-locks an already-destroyed |
| 69 | // mutex. |
| 70 | Valdi::Ref<Valdi::Thread> thread(reinterpret_cast<Valdi::Thread*>(ptr)); |