resource main1()
  import foo
  const int N = 5
  op done()
  cap foo  foo1, foo2
  foo1 = create foo(N, 1, done)
  foo2 = create foo(N, 2, done)
  for [ i = 1 to 2*N ] { receive done() }
  destroy foo1; destroy foo2
end
