diff --git a/packages/react-native-nitro-modules/cpp/jsi/JSIConverter+Future.hpp b/packages/react-native-nitro-modules/cpp/jsi/JSIConverter+Future.hpp index fc56d05ab..4db9774c8 100644 --- a/packages/react-native-nitro-modules/cpp/jsi/JSIConverter+Future.hpp +++ b/packages/react-native-nitro-modules/cpp/jsi/JSIConverter+Future.hpp @@ -25,15 +25,18 @@ using namespace facebook; // std::future <> Promise template struct JSIConverter> final { + [[deprecated("Use JSIConverter>> instead.")]] static inline std::future fromJSI(jsi::Runtime&, const jsi::Value&) { throw std::runtime_error("Promise cannot be converted to a native type - it needs to be awaited first!"); } + [[deprecated("Use JSIConverter>> instead.")]] static inline jsi::Value toJSI(jsi::Runtime& runtime, std::future&& arg) { auto promise = Promise::awaitFuture(std::move(arg)); return JSIConverter>>::toJSI(runtime, promise); } + [[deprecated("Use JSIConverter>> instead.")]] static inline bool canConvert(jsi::Runtime&, const jsi::Value&) { throw std::runtime_error("jsi::Value of type Promise cannot be converted to std::future yet!"); } diff --git a/packages/react-native-nitro-modules/cpp/threading/ThreadPool.cpp b/packages/react-native-nitro-modules/cpp/threading/ThreadPool.cpp index 02d4cbfcd..7a7fb635e 100644 --- a/packages/react-native-nitro-modules/cpp/threading/ThreadPool.cpp +++ b/packages/react-native-nitro-modules/cpp/threading/ThreadPool.cpp @@ -12,7 +12,7 @@ namespace margelo::nitro { ThreadPool::ThreadPool(const char* name, size_t initialThreadsCount, size_t maxThreadsCount) - : _isAlive(true), _name(name), _threadCountLimit(maxThreadsCount) { + : _isAlive(true), _threadCountLimit(maxThreadsCount), _name(name) { Logger::log(LogLevel::Info, TAG, "Creating ThreadPool \"%s\" with %i initial threads (max: %i)...", name, initialThreadsCount, maxThreadsCount);