- IntWrapper(int val) : _val(val) {}
-
- IntWrapper() : _val(0) {}
-
- IntWrapper(IntWrapper& copy) : _val(copy._val) {}
-
- int get() {
- return _val;
- }
-};
-
-static void* read_int(void *int_wrapper) {
- IntWrapper *ptr = (IntWrapper*) int_wrapper;
- return (void*) new int(ptr->get());
+int *readD1;
+int *readD2;
+static void read_thrd(void *obj) {
+ readD1 = new int;
+ readD2 = new int;
+ lock->read(readD1, readD2);
+ cout << "Read: d1 = " << *readD1 << ", d2 = " << *readD2 << endl;