Skip to content

Commit

Permalink
No need for thread attributes (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Sep 4, 2024
1 parent 4d2702b commit cc47d9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 0 additions & 2 deletions include/redisx-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef REDISX_PRIV_H_
#define REDISX_PRIV_H_



/// \cond PRIVATE

#include <pthread.h>
Expand Down
2 changes: 1 addition & 1 deletion include/redisx.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif

#ifndef REDIS_CMDBUF_SIZE
/// (bytes) Size of many internal arrays, and the max. send size. At least ~16 bytes...
/// (bytes) Size of many internal arrays, and the max. send chunk size. At least ~16 bytes...
# define REDIS_CMDBUF_SIZE 8192
#endif

Expand Down
9 changes: 2 additions & 7 deletions src/redisx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ typedef struct ServerLink {
static ServerLink *serverList;
static pthread_mutex_t serverLock = PTHREAD_MUTEX_INITIALIZER;


// The response listener threads...
static pthread_attr_t threadConfig;

/// \endcond

/// \cond PRIVATE
Expand Down Expand Up @@ -226,7 +222,6 @@ Redis *redisxInit(const char *server) {

if(!isInitialized) {
// Initialize the thread attributes once only to avoid segfaulting...
pthread_attr_init(&threadConfig);
atexit(rShutdownAsync);
isInitialized = TRUE;
}
Expand Down Expand Up @@ -801,7 +796,7 @@ int rStartSubscriptionListenerAsync(Redis *redis) {

p->isSubscriptionListenerEnabled = TRUE;

if (pthread_create(&p->subscriptionListenerTID, &threadConfig, RedisSubscriptionListener, redis) == -1) {
if (pthread_create(&p->subscriptionListenerTID, NULL, RedisSubscriptionListener, redis) == -1) {
perror("ERROR! Redis-X : pthread_create SubscriptionListener");
p->isSubscriptionListenerEnabled = FALSE;
return -1;
Expand Down Expand Up @@ -834,7 +829,7 @@ int rStartPipelineListenerAsync(Redis *redis) {

p->isPipelineListenerEnabled = TRUE;

if (pthread_create(&p->pipelineListenerTID, &threadConfig, RedisPipelineListener, redis) == -1) {
if (pthread_create(&p->pipelineListenerTID, NULL, RedisPipelineListener, redis) == -1) {
perror("ERROR! Redis-X : pthread_create PipelineListener");
p->isPipelineListenerEnabled = FALSE;
return -1;
Expand Down

0 comments on commit cc47d9e

Please sign in to comment.