Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
07026ce2
Commit
07026ce2
authored
Sep 12, 2003
by
Robert Ricci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an infinite loop bug - could only show up in some unlikely
circumstances with vnodes, but I managed to run into it.
parent
cc776f14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
assign/anneal.cc
assign/anneal.cc
+13
-7
No files found.
assign/anneal.cc
View file @
07026ce2
...
...
@@ -133,7 +133,20 @@ tb_pnode *find_pnode(tb_vnode *vn)
int
i
=
std
::
random
()
%
num_types
;
int
first
=
i
;
bool
first_time_through
=
true
;
for
(;;)
{
// Stopping condition - stop if we're back to the first one, and this isn't
// our first time through the loop
if
(
i
==
first
)
{
if
(
first_time_through
)
{
first_time_through
=
false
;
}
else
{
// Couldn't find a sutable node
return
NULL
;
}
}
i
=
(
i
+
1
)
%
num_types
;
// Skip pclasses that have been disabled
...
...
@@ -231,13 +244,6 @@ REDO_SEARCH:
RDEBUG
(
cout
<<
" to "
<<
newpnode
->
name
<<
endl
;)
return
newpnode
;
}
#ifndef PCLASS_SIZE_BALANCE
if
(
i
==
first
)
{
// couldn't find one
return
NULL
;
}
#endif
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment