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);
Definition: thread.test.h:16
Thread1(int &res, int val)
Definition: thread.test.h:27
int & res
Definition: thread.test.h:18
void * main()
Main thread function, executed in the new thread after creation.
Definition: thread.test.h:21
int val
Definition: thread.test.h:19
Definition: thread.test.h:32
int & res
Definition: thread.test.h:34
Thread2(int &res, Mutex &mutex)
Definition: thread.test.h:49
bool done
Definition: thread.test.h:36
Mutex & mutex
Definition: thread.test.h:35
void quit()
Definition: thread.test.h:51
void * main()
Main thread function, executed in the new thread after creation.
Definition: thread.test.h:38
Acquire a mutex lock, RAII-style.
Definition: mutex.h:201
pthread mutex wrapper; WARNING: the class allows copying and assignment, but this is not always safe.
Definition: mutex.h:48
Encapsulates a thread.
Definition: thread.h:84
void * join()
Join the thread.
Definition: thread.cpp:100
void start()
Start the thread.
Definition: thread.cpp:70
Definition: buffer.cpp:28
Definition: thread.test.h:12
Test execution()
Definition: thread.test.h:55
Test sharedMemory()
Definition: thread.test.h:65
void Test
Definition: test.h:178
#define assert_eq(x, y)
Definition: test.h:33