A Model of Cooperative Threads (Logical Methods in Computer Science, 2010)