|
Revision 3550, 1.5 KB
(checked in by sukyoungryu, 9 months ago)
|
|
[copyright] Fixed the copyright notices.
|
| Line | |
|---|
| 1 | (******************************************************************************* |
|---|
| 2 | Copyright 2009 Sun Microsystems, Inc., |
|---|
| 3 | 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
|---|
| 4 | All rights reserved. |
|---|
| 5 | |
|---|
| 6 | U.S. Government Rights - Commercial software. |
|---|
| 7 | Government users are subject to the Sun Microsystems, Inc. standard |
|---|
| 8 | license agreement and applicable provisions of the FAR and its supplements. |
|---|
| 9 | |
|---|
| 10 | Use is subject to license terms. |
|---|
| 11 | |
|---|
| 12 | This distribution may include materials developed by third parties. |
|---|
| 13 | |
|---|
| 14 | Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered |
|---|
| 15 | trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|---|
| 16 | ******************************************************************************) |
|---|
| 17 | |
|---|
| 18 | component abortBlock |
|---|
| 19 | export Executable |
|---|
| 20 | |
|---|
| 21 | run():()=do |
|---|
| 22 | iters : ZZ32 = 3000 |
|---|
| 23 | flag : Boolean := true |
|---|
| 24 | t = spawn do |
|---|
| 25 | label foo |
|---|
| 26 | atomic do |
|---|
| 27 | if flag then |
|---|
| 28 | printThreadInfo("Aborting") |
|---|
| 29 | abort() |
|---|
| 30 | (* Uncommenting this line causes things to work. *) |
|---|
| 31 | fail("Control should never get past abort!") |
|---|
| 32 | end |
|---|
| 33 | exit foo |
|---|
| 34 | end |
|---|
| 35 | end foo |
|---|
| 36 | end |
|---|
| 37 | var count:ZZ32 := 0 |
|---|
| 38 | for i <- seq(0#iters) do |
|---|
| 39 | count += 1 |
|---|
| 40 | if count = 100 |
|---|
| 41 | then print("."); count := 0; end |
|---|
| 42 | end |
|---|
| 43 | assert(t.ready(),false,"Thread appears to have terminated before condition") |
|---|
| 44 | flag := false |
|---|
| 45 | t.val() |
|---|
| 46 | end |
|---|
| 47 | end |
|---|