| 171 | } |
| 172 | |
| 173 | static int socketDownUseCount(xsMachine *the, xsSocket xss) |
| 174 | { |
| 175 | xsDestructor destructor; |
| 176 | |
| 177 | modCriticalSectionBegin(); |
| 178 | int8 useCount = --xss->useCount; |
| 179 | if (useCount > 0) { |
| 180 | modCriticalSectionEnd(); |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | xss->pending |= kPendingClose; |
| 185 | modCriticalSectionEnd(); |
| 186 | destructor = (kTCPListener == xss->kind) ? xs_listener_destructor : xs_socket_destructor; |
| 187 | (*destructor)(xss); |
| 188 | return 1; |
| 189 | } |
| 190 | |
| 191 | void xs_socket(xsMachine *the) |
| 192 | { |
no outgoing calls
no test coverage detected