Skip to content

Commit d02e028

Browse files
author
Herbert Koelman
committed
issue #14
debug auto_ptr
1 parent 08a0eab commit d02e028

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

tests/Makefile.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ CCFLAGS=$(CXXFLAGS)
3434

3535
LDFLAGS=@LDFLAGS@
3636

37-
OBJECTS=@OBJECTS@
38-
39-
TARGETS=pthread-tests
37+
OBJECTS=without-cpp11-pthread-tests.o
38+
TARGETS=without-cpp11-pthread-tests
4039

4140
all:${TARGETS}
4241

43-
pthread-tests: $(OBJECTS)
42+
without-cpp11-pthread-tests: without-cpp11-pthread-tests.o
4443

4544
clean: globber
4645

@@ -59,3 +58,6 @@ beautifull:
5958
# cpp build rule
6059
.cpp.o:
6160
$(CCC) $(CCFLAGS) -c $<
61+
62+
.cpp:
63+
$(CCC) $(CCFLAGS) $(LDFLAGS) $< -o $@

tests/without-cpp11-pthread-tests.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <string>
1212
#include <list>
1313
#include <utility>
14+
#include <memory>
1415
#include "pthread/pthread.hpp"
1516
#include "ibm.hpp"
1617

@@ -70,18 +71,15 @@ int main(int argc, const char * argv[]) {
7071
pthread::thread t2(w);
7172
t0 = ibm::move(t2) ;
7273
t0.join();
73-
//
74-
// pthread::thread t4(pthread::thread(w));
75-
// pthread::thread t1(w);
76-
//
77-
// t1.join();
78-
// t4.join();
74+
75+
std::auto_ptr<pthread::thread> pt0(new pthread::thread(w));
76+
pt0->join();
7977

8078
std::list<pthread::thread> threads;
81-
threads.push_back(pthread::thread(w));
82-
threads.push_back(pthread::thread(w));
83-
threads.push_back(pthread::thread(w));
84-
threads.push_back(pthread::thread(worker("herbert's worker")));
79+
// threads.push_back(pthread::thread(w));
80+
// threads.push_back(pthread::thread(w));
81+
// threads.push_back(pthread::thread(w));
82+
// threads.push_back(pthread::thread(worker("herbert's worker")));
8583

8684
message("main is waiting for threads to finish");
8785

0 commit comments

Comments
 (0)