for (int x= 0; x <= firstfree; ++x)
{
memcached_free(server_pool[x]);
- server_pool[x] = NULL;
+ server_pool[x]= NULL;
+ }
+
+ int error;
+ if ((error= pthread_mutex_destroy(&mutex)) != 0)
+ {
+ assert_vmsg(error != 0, "pthread_mutex_destroy() %s(%d)", strerror(error), error);
+ }
+
+ if ((error= pthread_cond_destroy(&cond)) != 0)
+ {
+ assert_vmsg(error != 0, "pthread_cond_destroy() %s", strerror(error));
}
- pthread_mutex_destroy(&mutex);
- pthread_cond_destroy(&cond);
delete [] server_pool;
if (_owns_master)
{
bool memcached_pool_st::init(uint32_t initial)
{
server_pool= new (std::nothrow) memcached_st *[size];
- if (not server_pool)
+ if (server_pool == NULL)
+ {
return false;
+ }
/*
Try to create the initial size of the pool. An allocation failure at
int unlock_error;
if ((unlock_error= pthread_mutex_unlock(&mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
if (thread_ret == ETIMEDOUT)
int unlock_error;
if ((unlock_error= pthread_mutex_unlock(&mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
return NULL;
if ((error= pthread_mutex_unlock(&mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
return ret;
/* we might have people waiting for a connection.. wake them up :-) */
if ((error= pthread_cond_broadcast(&cond)) != 0)
{
+ assert_vmsg(error != 0, "pthread_cond_broadcast() %s", strerror(error));
}
}
{
if ((error= pthread_mutex_unlock(&pool->mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
return rc;
}
if ((error= pthread_mutex_unlock(&pool->mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
return rc;
if ((error= pthread_mutex_unlock(&pool->mutex)) != 0)
{
+ assert_vmsg(error != 0, "pthread_mutex_unlock() %s", strerror(error));
}
return MEMCACHED_SUCCESS;