~brianaker/gearmand/gearmnan_job_use_client

« back to all changes in this revision

Viewing changes to libgearman-server/connection.cc

  • Committer: Continuous Integration
  • Date: 2013-01-14 19:17:24 UTC
  • mfrom: (683.1.2 gearmand-1.2)
  • Revision ID: ci@tangent.org-20130114191724-xvtsaq11a7mu28jt
Merge lp:~tangent-org/gearmand/1.2-build/ Build: jenkins-Gearmand-336

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
  if (thread->free_con_count > 0)
89
89
  {
90
90
    con= thread->free_con_list;
91
 
    GEARMAN_LIST_DEL(thread->free_con, con,)
 
91
    GEARMAN_LIST__DEL(thread->free_con, con);
92
92
  }
93
93
  else
94
94
  {
152
152
  int error;
153
153
  if ((error= pthread_mutex_lock(&thread->lock)) == 0)
154
154
  {
155
 
    GEARMAN_LIST_ADD(thread->con, con,);
 
155
    GEARMAN_LIST__ADD(thread->con, con);
156
156
    if ((error= pthread_mutex_unlock(&thread->lock)))
157
157
    {
158
158
      gearmand_log_fatal_perror(GEARMAN_DEFAULT_LOG_PARAM, error, "pthread_mutex_lock() failed");
265
265
  int lock_error;
266
266
  if ((lock_error= pthread_mutex_lock(&thread->lock)) == 0)
267
267
  {
268
 
    GEARMAN_LIST_DEL(con->thread->con, con,);
 
268
    GEARMAN_LIST__DEL(con->thread->con, con);
269
269
    if ((lock_error= pthread_mutex_unlock(&thread->lock)))
270
270
    {
271
271
      gearmand_log_fatal_perror(GEARMAN_DEFAULT_LOG_PARAM, lock_error, "pthread_mutex_unlock() failed");
279
279
 
280
280
  if (thread->free_con_count < GEARMAN_MAX_FREE_SERVER_CON)
281
281
  {
282
 
    GEARMAN_LIST_ADD(thread->free_con, con,)
 
282
    GEARMAN_LIST__ADD(thread->free_con, con);
283
283
 
284
284
    con->is_cleaned_up = true;
285
285
    return;
381
381
  }
382
382
  assert(lock_error == 0);
383
383
 
384
 
  GEARMAN_LIST_ADD(con->thread->to_be_freed, con, to_be_freed_)
 
384
  GEARMAN_LIST_ADD(con->thread->to_be_freed, con, to_be_freed_);
385
385
  con->to_be_freed_list = true;
386
386
 
387
387
  /* Looks funny, but need to check to_be_freed_count locked, but call run unlocked. */
419
419
    con= thread->to_be_freed_list;
420
420
    while (con != NULL)
421
421
    {
422
 
      GEARMAN_LIST_DEL(thread->to_be_freed, con, to_be_freed_)
 
422
      GEARMAN_LIST_DEL(thread->to_be_freed, con, to_be_freed_);
423
423
        if (con->to_be_freed_list)
424
424
        {
425
425
          con->to_be_freed_list= false;