+#include <iostream>
+#include <threads.h>
+#include "hashmap.h"
+
+HashMap *table;
+
+void threadA(void *arg) {
+ table->put(1, 11);
+ printf("Thrd A: Put %d -> %d\n", 1, 11);
+ int r1 = table->get(2);
+ printf("Thrd A: Get %d\n", r1);
+}
+
+void threadB(void *arg) {
+ table->put(2, 22);
+ printf("Thrd B: Put %d -> %d\n", 2, 22);
+ int r2 = table->get(1);
+ printf("Thrd B: Get %d\n", r2);
+}
+
+int user_main(int argc, char *argv[]) {
+ thrd_t t1, t2;
+
+ table = new HashMap;
+ table->put(1, 1);
+ table->put(2, 2);
+
+ thrd_create(&t1, threadA, NULL);
+ thrd_create(&t2, threadB, NULL);
+ thrd_join(t1);
+ thrd_join(t2);
+
+ return 0;
+}
+
+