~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/thr_lock.cc

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
*/
54
54
 
55
 
#include "config.h"
56
 
#include "drizzled/internal/my_sys.h"
57
 
#include "drizzled/internal/thread_var.h"
58
 
#include "drizzled/statistics_variables.h"
59
 
#include "drizzled/pthread_globals.h"
 
55
#include <config.h>
 
56
#include <drizzled/internal/my_sys.h>
 
57
#include <drizzled/internal/thread_var.h>
 
58
#include <drizzled/statistics_variables.h>
 
59
#include <drizzled/pthread_globals.h>
60
60
 
61
 
#include "drizzled/session.h"
 
61
#include <drizzled/session.h>
62
62
 
63
63
#include "thr_lock.h"
64
 
#include "drizzled/internal/m_string.h"
 
64
#include <drizzled/internal/m_string.h>
65
65
#include <errno.h>
66
66
#include <list>
67
67
 
91
91
 
92
92
uint64_t max_write_lock_count= UINT64_MAX;
93
93
 
94
 
void thr_multi_unlock(THR_LOCK_DATA **data,uint32_t count);
95
 
 
96
94
/*
97
95
** For the future (now the thread specific cond is alloced by my_pthread.c)
98
96
*/
348
346
    {
349
347
      if (!lock->write_wait.data)
350
348
      {                                         /* no scheduled write locks */
351
 
        bool concurrent_insert= 0;
352
 
        if (lock_type == TL_WRITE_CONCURRENT_INSERT)
353
 
        {
354
 
          concurrent_insert= 1;
355
 
        }
356
 
 
357
349
        if (!lock->read.data ||
358
350
            (lock_type <= TL_WRITE_CONCURRENT_INSERT &&
359
351
             ((lock_type != TL_WRITE_CONCURRENT_INSERT &&
606
598
      return(result);
607
599
    }
608
600
  }
609
 
  /*
610
 
    Ensure that all get_locks() have the same status
611
 
    If we lock the same table multiple times, we must use the same
612
 
    status_param!
613
 
  */
614
 
#if !defined(DONT_USE_RW_LOCKS)
615
 
  if (count > 1)
616
 
  {
617
 
    THR_LOCK_DATA *last_lock= end[-1];
618
 
    pos=end-1;
619
 
    do
620
 
    {
621
 
      pos--;
622
 
      last_lock=(*pos);
623
 
    } while (pos != data);
624
 
  }
625
 
#endif
626
601
  return(THR_LOCK_SUCCESS);
627
602
}
628
603