+/* Monitor thread tid and decide whether other threads (that are waiting for tid)
+ * should keep waiting for this thread or not. Shall only be called when a thread
+ * enters a function.
+ *
+ * Heuristics: If the distance from the current FuncNode to some target node
+ * ever increases, stop waiting for this thread on this target node.
+ */
+void ModelHistory::monitor_waiting_thread(uint32_t func_id, thread_id_t tid)
+{
+ WaitObj * wait_obj = getWaitObj(tid);
+ thrd_id_set_t * waited_by = wait_obj->getWaitedBy();
+
+ /* For each thread waiting for tid */
+ thrd_id_set_iter * iter = waited_by->iterator();
+
+ while (iter->hasNext()) {
+ thread_id_t other_id = iter->next();
+ WaitObj * other_wait_obj = getWaitObj(other_id);
+
+ node_set_t * target_nodes = other_wait_obj->getTargetNodes(tid);
+ node_set_iter * iter = target_nodes->iterator();
+ while (iter->hasNext()) {
+ FuncNode * target = iter->next();
+ int old_dist = other_wait_obj->lookup_dist(tid, target);
+ }
+ // TODO: Recompute distance from tmp to 'target' nodes
+ // FuncNode * tmp = func_nodes[func_id];
+ }
+}
+