Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b42c3f54f | ||
|
|
0b13c5f554 |
@@ -30,8 +30,6 @@
|
||||
|
||||
#include <math/mat3.h>
|
||||
|
||||
#include "AndroidNativeWindow.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -780,7 +780,7 @@ public:
|
||||
bool assert_texture_can_generate_mipmap = CORRECTNESS_ASSERTION_DEFAULT;
|
||||
} debug;
|
||||
struct {
|
||||
bool disable_gpu_frame_complete_metric = false;
|
||||
bool disable_gpu_frame_complete_metric = true;
|
||||
} frame_info;
|
||||
} engine;
|
||||
struct {
|
||||
|
||||
@@ -55,7 +55,10 @@ AsyncJobQueue::AsyncJobQueue(const char* name, Priority priority) {
|
||||
}
|
||||
|
||||
AsyncJobQueue::~AsyncJobQueue() noexcept {
|
||||
// wait for all pending callbacks to be called & terminate the thread
|
||||
drainAndExit();
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
assert_invariant(!mThread.joinable());
|
||||
assert_invariant(mQueue.empty());
|
||||
#endif
|
||||
}
|
||||
@@ -94,6 +97,9 @@ bool AsyncJobQueue::isValid() const noexcept {
|
||||
void AsyncJobQueue::drainAndExit() {
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
std::unique_lock lock(mLock);
|
||||
if (mExitRequested) {
|
||||
return;
|
||||
}
|
||||
// we request the service thread to exit, but we're guaranteed that it'll only exit
|
||||
// after all current callbacks are processed. In addition, once mExitRequested is set,
|
||||
// no new jobs can be added, so we can join the thread.
|
||||
|
||||
Reference in New Issue
Block a user