Minor fixes for moving to gcc

This commit is contained in:
Samer Afach 2017-06-08 07:34:06 +02:00
parent 2b8accbb55
commit 6952cf9372
3 changed files with 8 additions and 1 deletions

View File

@ -1,8 +1,14 @@
cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
project(ThreadPool)
add_library(threadpool_lib "include/ThreadPool.cpp")
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} threadpool_lib)
if(UNIX)
target_link_libraries(${PROJECT_NAME} threadpool_lib -pthread)
endif(UNIX)

View File

@ -19,6 +19,7 @@ it. Using this library is your own responsibility
#include <mutex>
#include <thread>
#include <vector>
#include <condition_variable>
class ThreadPool {
long numOfThreads;

View File

@ -7,7 +7,7 @@ void SumZeroToNumber(long &num) {
for (long i = 0; i <= static_cast<long>(num); i++) {
val += i;
}
static_cast<long>(num) = val;
num = val;
}
int main() {