X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=tests%2Flibmemcached-1.0%2Fpool.cc;h=a09faa69110afbdb11eefafd335f8b57dc18742d;hb=dfdbdc9f6d1b22eb717c8a77095dd617725022fe;hp=050d29277112287fbbab367535af463c8bd718e2;hpb=bf8213041709c75147393c8bd6b51b8f9e064f7c;p=awesomized%2Flibmemcached diff --git a/tests/libmemcached-1.0/pool.cc b/tests/libmemcached-1.0/pool.cc index 050d2927..a09faa69 100644 --- a/tests/libmemcached-1.0/pool.cc +++ b/tests/libmemcached-1.0/pool.cc @@ -243,10 +243,7 @@ struct test_pool_context_st { static __attribute__((noreturn)) void* connection_release(void *arg) { test_pool_context_st *resource= static_cast(arg); - if (resource == NULL) - { - fatal_message("resource == NULL"); - } + FATAL_IF(resource == NULL); // Release all of the memc we are holding resource->rc= memcached_pool_release(resource->pool, resource->mmc); @@ -343,7 +340,7 @@ static memcached_st * create_single_instance_memcached(const memcached_st *origi * I only want to hit _one_ server so I know the number of requests I'm * sending in the pipeline. */ - memcached_server_instance_st instance= memcached_server_instance_by_position(original_memc, 0); + const memcached_instance_st * instance= memcached_server_instance_by_position(original_memc, 0); char server_string[1024]; int server_string_length; @@ -396,17 +393,11 @@ static bool _running= false; static void set_running(const bool arg) { int error; - if ((error= pthread_mutex_lock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_lock(&mutex)) != 0, strerror(error)); _running= arg; - if ((error= pthread_mutex_unlock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_unlock(&mutex)) != 0, strerror(error)); } static bool running() @@ -414,17 +405,11 @@ static bool running() int error; bool ret; - if ((error= pthread_mutex_lock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_lock(&mutex)) != 0, strerror(error)); ret= _running; - if ((error= pthread_mutex_unlock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_unlock(&mutex)) != 0, strerror(error)); return ret; }