diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f790c8a..5dc67cf 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,8 +4,8 @@ "tasks": [ { "type": "cppbuild", - "label": "make", - "command": "make", + "label": "ninja", + "command": "ninja", "args": [], "options": { "cwd": "${workspaceFolder}/build/" @@ -21,7 +21,9 @@ "label": "cmake", "command": "cmake", "args": [ - ".." + "..", + "-G", + "Ninja" ], "options": { "cwd": "${workspaceFolder}/build/" diff --git a/CMakeLists.txt b/CMakeLists.txt index 096f9ed..b37b991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,21 +14,15 @@ aux_source_directory("src/Settings" settings) aux_source_directory("src/Utils" settings) add_executable(${BOT_NAME} ${coresrc} ${commands} ${settings}) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(THREADS_PREFER_PTHREAD_FLAG TRUE) -add_definitions( -DBOOST_ALL_NO_LIB ) set( Boost_USE_STATIC_LIBS ON ) -find_package(Threads REQUIRED) -find_package(OpenSSL REQUIRED) find_package(Boost REQUIRED) target_include_directories(${BOT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include - ${OPENSSL_INCLUDE_DIR} /usr/include/opus ) @@ -37,10 +31,5 @@ target_link_libraries(${BOT_NAME} opus ogg oggz - ${CMAKE_THREAD_LIBS_INIT} - ${OPENSSL_CRYPTO_LIBRARY} - ${OPENSSL_SSL_LIBRARY} ${Boost_LIBRARIES} -) - -link_directories(/usr/lib) \ No newline at end of file +) \ No newline at end of file diff --git a/include/Utils/ThreadPool.hpp b/include/Utils/ThreadPool.hpp deleted file mode 100644 index 8f3e481..0000000 --- a/include/Utils/ThreadPool.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace bumbleBee { -template -class ThreadPool { -public: - ThreadPool() = delete; - ThreadPool(std::int32_t threadCount); - - std::thread::id execute(std::function function); - void gracefullStop(std::thread::id thread); - void gracefullAllStop(); -private: - std::mutex mutex_; - std::condition_variable condition_; - std::int32_t threadCount_; - std::vector threadPool_; - std::unordered_map terminating_; -}; -} \ No newline at end of file diff --git a/src/Utils/ThreadPool.cpp b/src/Utils/ThreadPool.cpp deleted file mode 100644 index fee3ee3..0000000 --- a/src/Utils/ThreadPool.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "Utils/ThreadPool.hpp" - -namespace bumbleBee { - -template -ThreadPool::ThreadPool(std::int32_t threadCount) { - this.threadCount = threadCount; - while (threadCount--) { - threadPool. - } -} - -template -void ThreadPool::gracefullAllStop() { - std::unique_lock lock(mutex_); - for (auto& thread : threadPool_) { - terminating_[thread] = true; - condition_.notify_all(); - } - for (auto& thread : threadPool_) { - if (thread.joinable()) { - thread.join(); - } - } - threadPool_.clear(); - terminating_.clear(); -} -} \ No newline at end of file diff --git a/yt-dlp b/yt-dlp index ae873b3..daca82b 100755 Binary files a/yt-dlp and b/yt-dlp differ