3 #include "cliffc_hashtable.h"
7 template<typename TypeK, typename TypeV>
8 slot* const cliffc_hashtable<TypeK, TypeV>::MATCH_ANY = new slot(false, NULL);
10 template<typename TypeK, typename TypeV>
11 slot* const cliffc_hashtable<TypeK, TypeV>::NO_MATCH_OLD = new slot(false, NULL);
13 template<typename TypeK, typename TypeV>
14 slot* const cliffc_hashtable<TypeK, TypeV>::TOMBPRIME = new slot(true, NULL);
16 template<typename TypeK, typename TypeV>
17 slot* const cliffc_hashtable<TypeK, TypeV>::TOMBSTONE = new slot(false, NULL);
25 IntWrapper(int val) : _val(val) {}
27 IntWrapper() : _val(0) {}
29 IntWrapper(IntWrapper& copy) : _val(copy._val) {}
39 bool equals(const void *another) {
43 (IntWrapper*) another;
44 return ptr->_val == _val;
49 cliffc_hashtable<IntWrapper, IntWrapper> table;
52 void threadA(void *arg) {
53 IntWrapper k1(3), k2(4), v1(1), v2(2);
58 void threadB(void *arg) {
59 IntWrapper k1(3), k2(4), v1(1), v2(2);
63 int user_main(int argc, char *argv[]) {
65 val = new IntWrapper(0);
66 thrd_create(&t1, threadA, NULL);
67 thrd_create(&t2, threadB, NULL);
72 cout << "NULL" << endl;
74 cout << val->get() << endl;