24 return reinterpret_cast<void*
>(val);
27 Thread1(
int& res,
int val) : res(res), val(val) {}
50 res(res), mutex(mutex), done(false) {}
51 void quit() { done =
true; }
69 Thread2 incrementer(val, mutex);
int & res
Definition: thread.test.h:18
Thread1(int &res, int val)
Definition: thread.test.h:27
void quit()
Definition: thread.test.h:51
Thread2(int &res, Mutex &mutex)
Definition: thread.test.h:49
Definition: thread.test.h:12
void Test
Definition: test.h:178
void start()
Start the thread.
Definition: thread.cpp:70
void * main()
Main thread function, executed in the new thread after creation.
Definition: thread.test.h:21
Definition: buffer.cpp:28
bool done
Definition: thread.test.h:36
Acquire a mutex lock, RAII-style.
Definition: mutex.h:200
Mutex & mutex
Definition: thread.test.h:35
#define assert_eq(x, y)
Definition: test.h:33
int & res
Definition: thread.test.h:34
Encapsulates a thread.
Definition: thread.h:83
pthread mutex wrapper; WARNING: the class allows copying and assignment, but this is not always safe...
Definition: mutex.h:47
void * main()
Main thread function, executed in the new thread after creation.
Definition: thread.test.h:38
Definition: thread.test.h:15
int val
Definition: thread.test.h:19
void * join()
Join the thread.
Definition: thread.cpp:100
Test sharedMemory()
Definition: thread.test.h:65
Definition: thread.test.h:31
Test execution()
Definition: thread.test.h:55