OLD | NEW |
1 // run | 1 // run |
2 | 2 |
3 // Copyright 2009 The Go Authors. All rights reserved. | 3 // Copyright 2009 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 // trivial finalizer test | 7 // Test basic operation of finalizers. |
8 | 8 |
9 package main | 9 package main |
10 | 10 |
11 import ( | 11 import ( |
12 "runtime" | 12 "runtime" |
13 "time" | 13 "time" |
14 ) | 14 ) |
15 | 15 |
16 const N = 250 | 16 const N = 250 |
17 | 17 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 time.Sleep(1e6) | 68 time.Sleep(1e6) |
69 if nfinal >= N*8/10 { | 69 if nfinal >= N*8/10 { |
70 break | 70 break |
71 } | 71 } |
72 } | 72 } |
73 if nfinal < N*8/10 { | 73 if nfinal < N*8/10 { |
74 println("not enough finalizing:", nfinal, "/", N) | 74 println("not enough finalizing:", nfinal, "/", N) |
75 panic("fail") | 75 panic("fail") |
76 } | 76 } |
77 } | 77 } |
OLD | NEW |