~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Brian Aker
  • Date: 2008-12-05 19:17:37 UTC
  • Revision ID: brian@tangent.org-20081205191737-pp8u84pdz6dcp182
Part removal of my_pthread.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
548
548
  'var' parameter is NULL pointer.
549
549
*/
550
550
 
551
 
bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
 
551
bool update_sys_var_str(sys_var_str *var_str, pthread_rwlock_t *var_mutex,
552
552
                        set_var *var)
553
553
{
554
554
  char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
561
561
    Replace the old value in such a way that the any thread using
562
562
    the value will work.
563
563
  */
564
 
  rw_wrlock(var_mutex);
 
564
  pthread_rwlock_wrlock(var_mutex);
565
565
  old_value= var_str->value;
566
566
  var_str->value= res;
567
567
  var_str->value_length= new_length;
568
 
  rw_unlock(var_mutex);
 
568
  pthread_rwlock_unlock(var_mutex);
569
569
  free(old_value);
570
570
  return 0;
571
571
}
1938
1938
  }
1939
1939
 
1940
1940
  pthread_mutex_lock(&LOCK_global_system_variables);
1941
 
  logger.lock_exclusive();
1942
1941
 
1943
1942
  old_value= var_str->value;
1944
1943
  var_str->value= res;
1952
1951
    }
1953
1952
  }
1954
1953
 
1955
 
  logger.unlock();
1956
1954
  pthread_mutex_unlock(&LOCK_global_system_variables);
1957
1955
 
1958
1956
err: