/trunk/Examples/test-suite/go/director_thread_runme.go

# · Go · 28 lines · 19 code · 7 blank · 2 comment · 1 complexity · d882b53923a5f76a49d722642aed1b76 MD5 · raw file

  1. package main
  2. import . "./director_thread"
  3. type Derived struct {
  4. abi Foo
  5. } // From Foo
  6. func (p *Derived) Do_foo() {
  7. p.abi.SetVal(p.abi.GetVal() - 1)
  8. }
  9. func main() {
  10. // FIXME: This test fails until we fix callbacks from a
  11. // different thread.
  12. return
  13. p := &Derived{nil}
  14. d := NewDirectorFoo(p)
  15. p.abi = d
  16. d.Run()
  17. if d.GetVal() >= 0 {
  18. panic(d.GetVal())
  19. }
  20. d.Stop()
  21. }