Skip to content

Commit

Permalink
rwlock- config parser: deleted dead code, inserted initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Jul 3, 2018
1 parent de2fd3c commit fcc66f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/src/lib/parse_conf.h
Expand Up @@ -405,8 +405,8 @@ class DLL_IMP_EXP ConfigurationParser {

int32_t r_first_; /* First daemon resource type */
int32_t r_last_; /* Last daemon resource type */
ResourceTable *resources_; /* Pointer to table of permitted resources */
CommonResourceHeader **res_head_; /* Pointer to defined resources */
ResourceTable *resources_; /* Pointer to table of permitted resources */
CommonResourceHeader **res_head_; /* Pointer to defined resources */
brwlock_t res_lock_; /* Resource lock */

/*
Expand Down
22 changes: 12 additions & 10 deletions core/src/lib/rwlock.h
Expand Up @@ -43,20 +43,22 @@ typedef struct s_rwlock_tag {
int w_active; /* writers active */
int r_wait; /* readers waiting */
int w_wait; /* writers waiting */
s_rwlock_tag() {
mutex = PTHREAD_MUTEX_INITIALIZER;
read = PTHREAD_COND_INITIALIZER;
write = PTHREAD_COND_INITIALIZER;
writer_id = 0;
priority = 0;
valid = 0;
r_active = 0;
w_active = 0;
r_wait = 0;
w_wait = 0;
};
} brwlock_t;

typedef struct s_rwsteal_tag {
pthread_t writer_id; /* writer's thread id */
int state;
} brwsteal_t;


#define RWLOCK_VALID 0xfacade

#define RWL_INIIALIZER \
{ PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, \
PTHREAD_COND_INITIALIZER, RWLOCK_VALID, 0, 0, 0, 0 }

#define RwlWritelock(x) RwlWritelock_p((x), __FILE__, __LINE__)

/**
Expand Down

0 comments on commit fcc66f5

Please sign in to comment.