Commit 4220afa5 authored by unknown's avatar unknown

solaris fixes


include/lf.h:
  Forte fixes
parent 630169c6
...@@ -168,15 +168,15 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox); ...@@ -168,15 +168,15 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox);
lock_wrap(lf_pinbox_get_pins, LF_PINS *, lock_wrap(lf_pinbox_get_pins, LF_PINS *,
(LF_PINBOX *pinbox, void *stack_end), (LF_PINBOX *pinbox, void *stack_end),
(pinbox, stack_end), (pinbox, stack_end),
&pinbox->pinarray.lock); &pinbox->pinarray.lock)
lock_wrap_void(lf_pinbox_put_pins, lock_wrap_void(lf_pinbox_put_pins,
(LF_PINS *pins), (LF_PINS *pins),
(pins), (pins),
&pins->pinbox->pinarray.lock); &pins->pinbox->pinarray.lock)
lock_wrap_void(lf_pinbox_free, lock_wrap_void(lf_pinbox_free,
(LF_PINS *pins, void *addr), (LF_PINS *pins, void *addr),
(pins, addr), (pins, addr),
&pins->pinbox->pinarray.lock); &pins->pinbox->pinarray.lock)
/* /*
memory allocator, lf_alloc-pin.c memory allocator, lf_alloc-pin.c
...@@ -211,7 +211,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator); ...@@ -211,7 +211,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
lock_wrap(lf_alloc_new, void *, lock_wrap(lf_alloc_new, void *,
(LF_PINS *pins), (LF_PINS *pins),
(pins), (pins),
&pins->pinbox->pinarray.lock); &pins->pinbox->pinarray.lock)
/* /*
extendible hash, lf_hash.c extendible hash, lf_hash.c
......
...@@ -146,7 +146,7 @@ static int lock_compatibility_matrix[10][10]= ...@@ -146,7 +146,7 @@ static int lock_compatibility_matrix[10][10]=
One should never get N from it, we assert the impossibility One should never get N from it, we assert the impossibility
*/ */
static enum lock_type lock_combining_matrix[10][10]= static enum lockman_lock_type lock_combining_matrix[10][10]=
{/* N S X IS IX SIX LS LX SLX LSIX */ {/* N S X IS IX SIX LS LX SLX LSIX */
{ N, S, X, IS, IX, SIX, S, SLX, SLX, SIX}, /* N */ { N, S, X, IS, IX, SIX, S, SLX, SLX, SIX}, /* N */
{ S, S, X, S, SIX, SIX, S, SLX, SLX, SIX}, /* S */ { S, S, X, S, SIX, SIX, S, SLX, SLX, SIX}, /* S */
...@@ -249,7 +249,7 @@ static int lockfind(LOCK * volatile *head, LOCK *node, ...@@ -249,7 +249,7 @@ static int lockfind(LOCK * volatile *head, LOCK *node,
uint64 resource, cur_resource; uint64 resource, cur_resource;
intptr cur_link; intptr cur_link;
my_bool cur_active, compatible, upgrading, prev_active; my_bool cur_active, compatible, upgrading, prev_active;
enum lock_type lock, prev_lock, cur_lock; enum lockman_lock_type lock, prev_lock, cur_lock;
uint16 loid, cur_loid; uint16 loid, cur_loid;
int cur_flags, flags; int cur_flags, flags;
...@@ -596,13 +596,13 @@ static inline uint calc_hash(uint64 resource) ...@@ -596,13 +596,13 @@ static inline uint calc_hash(uint64 resource)
*/ */
enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo, enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo,
uint64 resource, uint64 resource,
enum lock_type lock) enum lockman_lock_type lock)
{ {
int res; int res;
uint csize, bucket, hashnr; uint csize, bucket, hashnr;
LOCK *node, * volatile *el, *blocker; LOCK *node, * volatile *el, *blocker;
LF_PINS *pins= lo->pins; LF_PINS *pins= lo->pins;
enum lock_type old_lock; enum lockman_lock_type old_lock;
DBUG_ASSERT(lo->loid); DBUG_ASSERT(lo->loid);
lf_rwlock_by_pins(pins); lf_rwlock_by_pins(pins);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
SLX - Shared + Loose eXclusive SLX - Shared + Loose eXclusive
LSIX - Loose Shared + Intention eXclusive LSIX - Loose Shared + Intention eXclusive
*/ */
enum lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST }; enum lockman_lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
struct lockman_lock; struct lockman_lock;
...@@ -66,7 +66,7 @@ void lockman_init(LOCKMAN *, loid_to_lo_func *, uint); ...@@ -66,7 +66,7 @@ void lockman_init(LOCKMAN *, loid_to_lo_func *, uint);
void lockman_destroy(LOCKMAN *); void lockman_destroy(LOCKMAN *);
enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo, enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo,
uint64 resource, uint64 resource,
enum lock_type lock); enum lockman_lock_type lock);
int lockman_release_locks(LOCKMAN *, LOCK_OWNER *); int lockman_release_locks(LOCKMAN *, LOCK_OWNER *);
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
......
...@@ -162,7 +162,7 @@ static const int lock_compatibility_matrix[10][10]= ...@@ -162,7 +162,7 @@ static const int lock_compatibility_matrix[10][10]=
One should never get N from it, we assert the impossibility One should never get N from it, we assert the impossibility
*/ */
static const enum lock_type lock_combining_matrix[10][10]= static const enum lockman_lock_type lock_combining_matrix[10][10]=
{/* N S X IS IX SIX LS LX SLX LSIX */ {/* N S X IS IX SIX LS LX SLX LSIX */
{ N, N, N, N, N, N, N, N, N, N}, /* N */ { N, N, N, N, N, N, N, N, N, N}, /* N */
{ N, S, X, S, SIX, SIX, S, SLX, SLX, SIX}, /* S */ { N, S, X, S, SIX, SIX, S, SLX, SLX, SIX}, /* S */
...@@ -269,13 +269,13 @@ void remove_from_wait_queue(TABLE_LOCK *lock, LOCKED_TABLE *table) ...@@ -269,13 +269,13 @@ void remove_from_wait_queue(TABLE_LOCK *lock, LOCKED_TABLE *table)
*/ */
enum lockman_getlock_result enum lockman_getlock_result
tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo, tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo,
LOCKED_TABLE *table, enum lock_type lock) LOCKED_TABLE *table, enum lockman_lock_type lock)
{ {
TABLE_LOCK *old, *new, *blocker, *blocker2; TABLE_LOCK *old, *new, *blocker, *blocker2;
TABLE_LOCK_OWNER *wait_for; TABLE_LOCK_OWNER *wait_for;
ulonglong deadline; ulonglong deadline;
struct timespec timeout; struct timespec timeout;
enum lock_type new_lock; enum lockman_lock_type new_lock;
enum lockman_getlock_result res; enum lockman_getlock_result res;
int i; int i;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
*/ */
#ifndef _lockman_h #ifndef _lockman_h
/* QQ: TODO remove N-locks */ /* QQ: TODO remove N-locks */
enum lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST }; enum lockman_lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
enum lockman_getlock_result { enum lockman_getlock_result {
NO_MEMORY_FOR_LOCK=1, DEADLOCK, LOCK_TIMEOUT, NO_MEMORY_FOR_LOCK=1, DEADLOCK, LOCK_TIMEOUT,
GOT_THE_LOCK, GOT_THE_LOCK,
...@@ -74,7 +74,7 @@ typedef struct { ...@@ -74,7 +74,7 @@ typedef struct {
void tablockman_init(TABLOCKMAN *, loid_to_tlo_func *, uint); void tablockman_init(TABLOCKMAN *, loid_to_tlo_func *, uint);
void tablockman_destroy(TABLOCKMAN *); void tablockman_destroy(TABLOCKMAN *);
enum lockman_getlock_result tablockman_getlock(TABLOCKMAN *, TABLE_LOCK_OWNER *, enum lockman_getlock_result tablockman_getlock(TABLOCKMAN *, TABLE_LOCK_OWNER *,
LOCKED_TABLE *, enum lock_type); LOCKED_TABLE *, enum lockman_lock_type);
void tablockman_release_locks(TABLOCKMAN *, TABLE_LOCK_OWNER *); void tablockman_release_locks(TABLOCKMAN *, TABLE_LOCK_OWNER *);
void tablockman_init_locked_table(LOCKED_TABLE *, int); void tablockman_init_locked_table(LOCKED_TABLE *, int);
void tablockman_destroy_locked_table(LOCKED_TABLE *); void tablockman_destroy_locked_table(LOCKED_TABLE *);
......
...@@ -157,7 +157,7 @@ pthread_mutex_t rt_mutex; ...@@ -157,7 +157,7 @@ pthread_mutex_t rt_mutex;
int Nrows= 100; int Nrows= 100;
int Ntables= 10; int Ntables= 10;
int table_lock_ratio= 10; int table_lock_ratio= 10;
enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX}; enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"}; char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
char *res2str[4]= { char *res2str[4]= {
"DIDN'T GET THE LOCK", "DIDN'T GET THE LOCK",
......
...@@ -166,7 +166,7 @@ pthread_mutex_t rt_mutex; ...@@ -166,7 +166,7 @@ pthread_mutex_t rt_mutex;
int Nrows= 100; int Nrows= 100;
int Ntables= 10; int Ntables= 10;
int table_lock_ratio= 10; int table_lock_ratio= 10;
enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX}; enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"}; char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
char *res2str[]= { char *res2str[]= {
"DIDN'T GET THE LOCK", "DIDN'T GET THE LOCK",
......
...@@ -193,7 +193,7 @@ pthread_mutex_t rt_mutex; ...@@ -193,7 +193,7 @@ pthread_mutex_t rt_mutex;
int Nrows= 100; int Nrows= 100;
int Ntables= 10; int Ntables= 10;
int table_lock_ratio= 10; int table_lock_ratio= 10;
enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX}; enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
const char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"}; const char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
const char *res2str[]= { const char *res2str[]= {
0, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment