Skip to content

Commit

Permalink
Use proper locking function (via the generic locking API)
Browse files Browse the repository at this point in the history
Reported by Max E. Reyes Vera Juarez.
  • Loading branch information
bogdan-iancu committed Oct 29, 2013
1 parent adfe53f commit c5b2030
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/load_balancer/lb_data.c
Expand Up @@ -509,7 +509,7 @@ int do_load_balance(struct sip_msg *req, int grp, struct lb_res_str_list *rl,

/* lock the resources */
for( i=0 ; i<rl->n ; i++)
get_lock( call_res[i]->lock );
lock_get( call_res[i]->lock );

/* do the load-balancing */
load = 0;
Expand Down Expand Up @@ -557,7 +557,7 @@ int do_load_balance(struct sip_msg *req, int grp, struct lb_res_str_list *rl,

/* unlock the resources*/
for( i=0 ; i<rl->n ; i++)
release_lock( call_res[i]->lock );
lock_release( call_res[i]->lock );

if (dst) {
LM_DBG("winning destination <%.*s> selected for LB set with free=%d\n",
Expand Down Expand Up @@ -736,7 +736,7 @@ int lb_count_call(struct lb_data *data, struct sip_msg *req,

/* lock the resources */
for( i=0 ; i<rl->n ; i++)
get_lock( call_res[i]->lock );
lock_get( call_res[i]->lock );

/* add to the profiles */
for( i=0 ; i<rl->n ; i++) {
Expand All @@ -747,7 +747,7 @@ int lb_count_call(struct lb_data *data, struct sip_msg *req,

/* unlock the resources*/
for( i=0 ; i<rl->n ; i++)
release_lock( call_res[i]->lock );
lock_release( call_res[i]->lock );

return 0;
}
Expand Down

0 comments on commit c5b2030

Please sign in to comment.