/src/wrappers/glib/examples/thread_pool_example.e

http://github.com/tybor/Liberty · Specman e · 20 lines · 17 code · 2 blank · 1 comment · 0 complexity · 01e6cc11aa28df8c2c2c11f59319583a MD5 · raw file

  1. class THREAD_POOL_EXAMPLE
  2. inherit G_THREAD_POOL [DO_STUFF]
  3. creation main
  4. feature
  5. main is
  6. -- Starting point
  7. do
  8. make(12, False) -- maximum twelve non exclusive threads.
  9. (1|..|100).do_all(agent (i: INTEGER_32) is
  10. do
  11. push (create {DO_STUFF}.make(100000+i))
  12. end)
  13. end
  14. new_routine: DO_STUFF is
  15. do
  16. create Result
  17. end
  18. end