diff --git a/CMakeLists.txt b/CMakeLists.txt index 34c48fe..93264c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ include_directories ( set(HEADERS include/SafeQueue.h include/ThreadPool.h) -set(SOURCES src/main.cpp) +set(SOURCES example/main.cpp) SET(CMAKE_CXX_FLAGS -pthread) diff --git a/example/example.cpp b/example/main.cpp similarity index 97% rename from example/example.cpp rename to example/main.cpp index ea90694..469d068 100644 --- a/example/example.cpp +++ b/example/main.cpp @@ -36,7 +36,8 @@ int multiply_return(const int a, const int b) { } -void example() { +int main(int argc, char *argv[]) +{ // Create pool with 3 threads ThreadPool pool(3); @@ -66,4 +67,6 @@ void example() { std::cout << "Last operation result is equals to " << res << std::endl; pool.shutdown(); + + return 0; }