diff --git a/CMakeLists.txt b/CMakeLists.txt index d55c8607..e1c43079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif() # Project configuration # -project(uvw VERSION 1.13.0) +project(uvw VERSION 1.14.0) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) diff --git a/cmake/in/deps.in b/cmake/in/deps.in index 709869f1..90044df0 100644 --- a/cmake/in/deps.in +++ b/cmake/in/deps.in @@ -17,7 +17,7 @@ ExternalProject_Add( ExternalProject_Add( libuv GIT_REPOSITORY https://github.com/libuv/libuv.git - GIT_TAG v1.25.0 + GIT_TAG v1.26.0 SOURCE_DIR @LIBUV_DEPS_DIR@ CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/conanfile.py b/conanfile.py index c22e7b90..20245867 100644 --- a/conanfile.py +++ b/conanfile.py @@ -14,7 +14,7 @@ class UVMConan(ConanFile): exports = "LICENSE" exports_sources = "src/*" no_copy_source = True - requires = "libuv/1.25.0@bincrafters/stable" + requires = "libuv/1.26.0@bincrafters/stable" def package(self): self.copy(pattern="LICENSE", dst="licenses") diff --git a/src/uvw/thread.hpp b/src/uvw/thread.hpp index 743301ec..d41be8cc 100644 --- a/src/uvw/thread.hpp +++ b/src/uvw/thread.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -13,6 +14,18 @@ namespace uvw { +namespace details { + + +enum class UVThreadCreateFlags: std::underlying_type_t { + THREAD_NO_FLAGS = UV_THREAD_NO_FLAGS, + THREAD_HAS_STACK_SIZE = UV_THREAD_HAS_STACK_SIZE +}; + + +} + + class Thread; class ThreadLocalStorage; class Once; @@ -32,6 +45,7 @@ class Thread final: public UnderlyingType { } public: + using Options = details::UVThreadCreateFlags; using Task = InternalTask; using Type = uv_thread_t; @@ -55,6 +69,11 @@ public: return (0 == uv_thread_create(get(), &createCallback, this)); } + bool run(Flags opts, std::size_t stack = {}) noexcept { + uv_thread_options_t params{opts, stack}; + return (0 == uv_thread_create_ex(get(), ¶ms, &createCallback, this)); + } + bool join() noexcept { return (0 == uv_thread_join(get())); }