* hinfo.cc (hinfo::find_unused_handle): Just check for table entry == NULL

since we are already bounds checked by default.
* thread.cc (ResourceLocks::Lock): Streamline this function since it is called
a lot.
(ReleaseResourceLock): Ditto.
This commit is contained in:
Christopher Faylor
2000-08-04 04:04:46 +00:00
parent e5dd88116a
commit 91892f50d9
4 changed files with 112 additions and 110 deletions

View File

@@ -125,12 +125,13 @@ hinfo::not_open (int fd)
int
hinfo::find_unused_handle (int start)
{
AssertResourceOwner(LOCK_FD_LIST,READ_LOCK);
AssertResourceOwner(LOCK_FD_LIST, READ_LOCK);
do
{
for (int i = start; i < (int) size; i++)
if (not_open (i))
/* See if open -- no need for overhead of not_open */
if (fds[i] == NULL)
return i;
}
while (extend (NOFILE_INCR));