From 10294369b9624383f757e93903f3eec2debb3474 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 22 Apr 2016 23:23:51 -0700 Subject: 2855 --- 062scheduler.cc | 18 ------------------ 063wait.cc | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/062scheduler.cc b/062scheduler.cc index 00e6c58a..6ffe15b3 100644 --- a/062scheduler.cc +++ b/062scheduler.cc @@ -479,22 +479,12 @@ if (Passed && any_routines_with_error()) { raise << "some routines died with errors\n" << end(); ++Num_failures; } -if (Passed && any_routines_waiting()) { - Passed = false; - raise << "deadlock!\n" << end(); - ++Num_failures; -} :(before "End Mu Test Teardown") if (Passed && any_routines_with_error()) { Passed = false; raise << Current_scenario->name << ": some routines died with errors\n" << end(); ++Num_failures; } -if (Passed && any_routines_waiting()) { - Passed = false; - raise << Current_scenario->name << ": deadlock!\n" << end(); - ++Num_failures; -} :(code) bool any_routines_with_error() { @@ -505,14 +495,6 @@ bool any_routines_with_error() { return false; } -bool any_routines_waiting() { - for (int i = 0; i < SIZE(Routines); ++i) { - if (Routines.at(i)->state == WAITING) - return true; - } - return false; -} - :(before "End routine Fields") int limit; :(before "End routine Constructor") diff --git a/063wait.cc b/063wait.cc index 19bfb2d8..1adc9ad4 100644 --- a/063wait.cc +++ b/063wait.cc @@ -29,6 +29,27 @@ int old_value_of_waiting_location; :(before "End routine Constructor") waiting_on_location = old_value_of_waiting_location = 0; +:(before "End Mu Test Teardown") +if (Passed && any_routines_waiting()) { + Passed = false; + raise << Current_scenario->name << ": deadlock!\n" << end(); + ++Num_failures; +} +:(before "End Test Teardown") +if (Passed && any_routines_with_error()) { + Passed = false; + raise << "some routines died with errors\n" << end(); + ++Num_failures; +} +:(code) +bool any_routines_waiting() { + for (int i = 0; i < SIZE(Routines); ++i) { + if (Routines.at(i)->state == WAITING) + return true; + } + return false; +} + //: primitive recipe to put routines in that state :(before "End Primitive Recipe Declarations") -- cgit 1.4.1-2-gfad0 /tree/?h=v1.5.1&id=efd7c0c16203cdeafcd58201d509325129397a67'>root/ranger.py
blob: 5652ba69f91801a14af034f92305d16483c33959 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56