From 4ca39022931683e46860316cf5f948dc89dfe8c2 Mon Sep 17 00:00:00 2001 From: Bo Wang Date: Tue, 22 Apr 2014 21:57:19 -0400 Subject: [PATCH] chapter 1 code --- ch1/Makefile | 19 +++++++++++++++++++ ch1/hello.cpp | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ch1/Makefile create mode 100644 ch1/hello.cpp diff --git a/ch1/Makefile b/ch1/Makefile new file mode 100644 index 0000000..66b434d --- /dev/null +++ b/ch1/Makefile @@ -0,0 +1,19 @@ +CPP = g++-4.8 +CPPFLAGS = -g -std=c++0x +OFLAG = -o +.SUFFIXES : .o .cpp .c +.cpp.o : + $(CPP) $(CPPFLAGS) -c $< +.c.o : + $(CPP) $(CPPFLAGS) -c $< + +PROGS = hello + +all: $(PROGS) + +hello: hello.o + $(CPP) $(OFLAG) hello hello.o + +clean: + rm -f ${PROGS} *.o + diff --git a/ch1/hello.cpp b/ch1/hello.cpp new file mode 100644 index 0000000..50378c1 --- /dev/null +++ b/ch1/hello.cpp @@ -0,0 +1,18 @@ +#include +#include + +void hello() +{ + std::cout << "Hello Concurrent World\n"; +} + +int main() +{ + //boost::thread t([]() + std::thread t([]() + { + std::cout << "Hello Concurrent World\n"; + }); + + t.join(); +}