Generating Well-Synchronized Multithreaded Programs from Software Architecture Descriptions