cobegin hunter( ); peasant( ); zoo( ); restaurant( ); coend } hunter( ) { while (true) {
P(cage); place a tiger; V(tiger); } } peasant( ) { while (true) {
P(cage); place a pig; V(pig); } } zoo( ) { while (true) {
P(tiger); take a tiger; V(cage); } }
restaurant( ) { while (true) {
P(pig); take a pig; V(cage); }
}
相关推荐: