| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 */ | 4 |
| 5 #include "nacl_io/kernel_object.h" | 5 #include "nacl_io/kernel_object.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <map> | 13 #include <map> |
| 14 #include <string> | 14 #include <string> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 AUTO_LOCK(handle_lock_); | 194 AUTO_LOCK(handle_lock_); |
| 195 | 195 |
| 196 handle_map_[fd].reset(NULL); | 196 handle_map_[fd].reset(NULL); |
| 197 free_fds_.push_back(fd); | 197 free_fds_.push_back(fd); |
| 198 | 198 |
| 199 // Force lower numbered FD to be available first. | 199 // Force lower numbered FD to be available first. |
| 200 std::push_heap(free_fds_.begin(), free_fds_.end(), std::greater<int>()); | 200 std::push_heap(free_fds_.begin(), free_fds_.end(), std::greater<int>()); |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace nacl_io | 203 } // namespace nacl_io |
| OLD | NEW |