* 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:
@@ -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));
|
||||
|
Reference in New Issue
Block a user