}
-static void close_socket(switch_socket_t **sock)
+static void close_socket(switch_socket_t **sock, skinny_profile_t *profile)
{
- /* TODO
switch_mutex_lock(profile->sock_mutex);
- */
if (*sock) {
switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE);
switch_socket_close(*sock);
*sock = NULL;
}
- /* TODO
switch_mutex_unlock(profile->sock_mutex);
- */
}
static switch_status_t kill_listener(listener_t *listener, void *pvt)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Killing listener.\n");
switch_clear_flag(listener, LFLAG_RUNNING);
- close_socket(&listener->sock);
+ close_socket(&listener->sock, listener->profile);
return SWITCH_STATUS_SUCCESS;
}
}
if (listener->sock) {
- close_socket(&listener->sock);
+ close_socket(&listener->sock, profile);
}
switch_thread_rwlock_unlock(listener->rwlock);
end:
- close_socket(&profile->sock);
+ close_socket(&profile->sock, profile);
if (pool) {
switch_core_destroy_memory_pool(&pool);
switch_hash_this(hi, NULL, NULL, &val);
profile = (skinny_profile_t *) val;
- close_socket(&profile->sock);
+ close_socket(&profile->sock, profile);
while (profile->listener_threads) {
switch_yield(100000);