summaryrefslogtreecommitdiffstats
path: root/test/queue_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-17 22:06:28 +0000
committerDavid Robillard <d@drobilla.net>2012-08-17 22:06:28 +0000
commitcd6209bcdd686b630bece9dc7b73e24584dbf769 (patch)
treec8295ad5056ad25ff72de6e40018fe86dbedbb6b /test/queue_test.cpp
parent882245f41683924d0465b5afac2f8bb5c3786e60 (diff)
downloadraul-cd6209bcdd686b630bece9dc7b73e24584dbf769.tar.gz
raul-cd6209bcdd686b630bece9dc7b73e24584dbf769.tar.bz2
raul-cd6209bcdd686b630bece9dc7b73e24584dbf769.zip
Update test suite to compile and pass again.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4718 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test/queue_test.cpp')
-rw-r--r--test/queue_test.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/queue_test.cpp b/test/queue_test.cpp
index e894647..bcdf039 100644
--- a/test/queue_test.cpp
+++ b/test/queue_test.cpp
@@ -27,7 +27,7 @@
#include "raul/SRMWQueue.hpp"
#include "raul/SRSWQueue.hpp"
#include "raul/Thread.hpp"
-#include "raul/log.hpp"
+#include "raul/fmt.hpp"
using namespace std;
using namespace Raul;
@@ -63,11 +63,11 @@ SRMWQueue<WriteAction> queue(QUEUE_SIZE);
class WriteThread : public Thread {
public:
- WriteThread(const std::string& name) : Thread(name) {}
+ WriteThread() {}
protected:
void _run() {
- while (true) {
+ while (!_exit_flag) {
for (unsigned j=0; j < PUSHES_PER_ITERATION; ++j) {
unsigned i = rand() % NUM_DATA;
if (queue.push(WriteAction(i))) {
@@ -77,10 +77,6 @@ protected:
//cerr << "FAILED WRITE\r\n";
}
}
-
- // This thread will never cancel without this here since
- // this loop is hard RT safe and thus cancellation point free
- pthread_testcancel();
}
cout << "Writer exiting." << endl;
@@ -136,7 +132,7 @@ main()
vector<WriteThread*> writers(NUM_WRITERS, NULL);
for (unsigned i=0; i < NUM_WRITERS; ++i) {
- writers[i] = new WriteThread((Raul::fmt("Writer %1%") % i).str());
+ writers[i] = new WriteThread();
writers[i]->start();
}
@@ -163,7 +159,7 @@ main()
// Stop the writers
for (unsigned i=0; i < NUM_WRITERS; ++i)
- writers[i]->stop();
+ writers[i]->join();
//cout << "\n\n****************** DONE *********************\n\n";