PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1class MY_THREAD
 2inherit G_THREAD 
 3feature 
 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	
12
13	upper: INTEGER_32
14	set(n: like upper) is do upper:=n end
15	sleep (a: NATURAL_32) is
16		external "C use <unistd.h>"
17		end
18end