Constraint Graph Analysis of Multithreaded Programs