/src/wrappers/glib/examples/my_thread.e

http://github.com/tybor/Liberty · Specman e · 18 lines · 13 code · 2 blank · 3 comment · 0 complexity · 45a28501e51af22612e79b04410fefc2 MD5 · raw file

  1. class MY_THREAD
  2. inherit G_THREAD
  3. feature
  4. run is
  5. do
  6. -- print("I'm a new thread, doing hard work (sleeping) for "+secs.to_string+" seconds%N")
  7. -- sleep(secs.to_natural_32)
  8. -- print("Done!%N")
  9. (1|..|upper).for_all(agent is_prime)
  10. end
  11. upper: INTEGER_32
  12. set(n: like upper) is do upper:=n end
  13. sleep (a: NATURAL_32) is
  14. external "C use <unistd.h>"
  15. end
  16. end