The sockpool mutex must be locked at this point */
| 1884 | |
| 1885 | /* The sockpool mutex must be locked at this point */ |
| 1886 | static int sockpool_get_from_pool(void) |
| 1887 | { |
| 1888 | int fd = -1; |
| 1889 | for (int i = 0; i < sockpool_fd_count; i++) { |
| 1890 | struct sockpool_fd_list *sp = &sockpool_fds[i]; |
| 1891 | if (sp->in_use == 0 && sp->sockpool_fd > -1) { |
| 1892 | fd = sp->sockpool_fd; |
| 1893 | sp->in_use = 1; |
| 1894 | break; |
| 1895 | } |
| 1896 | } |
| 1897 | return fd; |
| 1898 | } |
| 1899 | |
| 1900 | /* The sockpool mutex must be locked at this point */ |
| 1901 | static int sockpool_place_fd_in_pool(int fd) |
no outgoing calls
no test coverage detected