/[eiffelstudio]/trunk/eweasel/tests/thread021/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/thread021/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 88265 - (show annotations)
Fri Feb 3 01:43:35 2012 UTC (7 years, 11 months ago) by manus
File size: 923 byte(s)
Adapted tests to breaking changed in class THREAD where the later requires `make' to be called as part of the creation of a THREAD object.

1 class TEST
2
3 inherit
4 EXCEPTIONS
5
6 create
7 make
8
9 feature
10 make
11 local
12 l_crash_thread: WORKER_THREAD
13 l_worker_thread: WORKER_THREAD
14 i: INTEGER
15 do
16 create mutex.make
17 create exec
18 create l_crash_thread.make (agent crash)
19 l_crash_thread.launch
20 from
21 i := 1
22 until
23 i = 50
24 loop
25 create l_worker_thread.make (agent execute)
26 l_worker_thread.launch
27 i := i + 1
28 end
29 l_crash_thread.join
30 end
31
32 exec: EXECUTION_ENVIRONMENT
33 counter: INTEGER
34 mutex: MUTEX
35
36 execute
37 local
38 i: INTEGER
39 l_mem: MEMORY
40 do
41 mutex.lock
42 counter := counter + 1
43 mutex.unlock
44 create l_mem
45 from
46 i := 1
47 until
48 i = 10_000
49 loop
50 l_mem.collect
51 i := i + 1
52 end
53 end
54
55 crash
56 local
57 l_counter: INTEGER
58 do
59 from
60 until
61 l_counter >= 10
62 loop
63 exec.sleep (1_000_000_000)
64 mutex.lock
65 l_counter := counter
66 mutex.unlock
67 end
68 die (1)
69 end
70
71 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23