We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55541ae commit 08997eeCopy full SHA for 08997ee
1 file changed
packages/host/cpp/ThreadsafeFunction.cpp
@@ -171,10 +171,6 @@ napi_status ThreadSafeFunction::call(
171
// Auto-finalize when: no remaining threads (acquire/release balance),
172
// queue drained, and not already closing.
173
if (!self->threadCount_ && empty) {
174
- // if (self->maxQueueSize_) {
175
- // std::lock_guard lock{self->queueMutex_};
176
- // self->queueCv_.notify_all();
177
- // }
178
self->finalize();
179
}
180
});
@@ -228,10 +224,10 @@ napi_status ThreadSafeFunction::unref() {
228
224
229
225
230
226
void ThreadSafeFunction::finalize() {
231
- if (handlesClosing_) {
227
+ if (finalizeScheduled_) {
232
return;
233
234
- handlesClosing_ = true;
+ finalizeScheduled_ = true;
235
closing_ = true;
236
237
const auto onFinalize = [self = shared_from_this()] {
0 commit comments