Skip to content

Commit 55541ae

Browse files
committed
chore: changed name + added nodiscard
1 parent 14d9641 commit 55541ae

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/host/cpp/ThreadsafeFunction.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ class ThreadSafeFunction
4040

4141
static std::shared_ptr<ThreadSafeFunction> get(napi_threadsafe_function func);
4242

43-
napi_status getContext(void** result);
44-
napi_status call(void* data, napi_threadsafe_function_call_mode isBlocking);
45-
napi_status acquire();
46-
napi_status release(napi_threadsafe_function_release_mode mode);
43+
[[nodiscard]] napi_status getContext(void** result);
44+
[[nodiscard]] napi_status call(
45+
void* data, napi_threadsafe_function_call_mode isBlocking);
46+
[[nodiscard]] napi_status acquire();
47+
[[nodiscard]] napi_status release(napi_threadsafe_function_release_mode mode);
4748
// Node-API compatibility: These do not affect RN's lifecycle. We only track
4849
// the state for diagnostics and API parity with libuv's ref/unref.
49-
napi_status ref();
50-
napi_status unref();
50+
[[nodiscard]] napi_status ref();
51+
[[nodiscard]] napi_status unref();
5152

5253
private:
5354
void finalize();
@@ -70,7 +71,7 @@ class ThreadSafeFunction
7071
std::queue<void*> queue_;
7172
std::atomic<bool> closing_{false};
7273
std::atomic<bool> referenced_{true};
73-
std::atomic<bool> handlesClosing_{false};
74+
std::atomic<bool> finalizeScheduled_{false};
7475
};
7576

7677
} // namespace callstack::nodeapihost

0 commit comments

Comments
 (0)