Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a9d5a3ff
Commit
a9d5a3ff
authored
Dec 18, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solaris fixes
include/lf.h: Forte fixes
parent
76051e1a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
18 deletions
+18
-18
include/lf.h
include/lf.h
+4
-4
storage/maria/lockman.c
storage/maria/lockman.c
+4
-4
storage/maria/lockman.h
storage/maria/lockman.h
+2
-2
storage/maria/tablockman.c
storage/maria/tablockman.c
+3
-3
storage/maria/tablockman.h
storage/maria/tablockman.h
+2
-2
storage/maria/unittest/lockman-t.c
storage/maria/unittest/lockman-t.c
+1
-1
storage/maria/unittest/lockman1-t.c
storage/maria/unittest/lockman1-t.c
+1
-1
storage/maria/unittest/lockman2-t.c
storage/maria/unittest/lockman2-t.c
+1
-1
No files found.
include/lf.h
View file @
a9d5a3ff
...
@@ -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
...
...
storage/maria/lockman.c
View file @
a9d5a3ff
...
@@ -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
lock
man_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
lock
man_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
lock
man_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
lock
man_lock
_type
old_lock
;
DBUG_ASSERT
(
lo
->
loid
);
DBUG_ASSERT
(
lo
->
loid
);
lf_rwlock_by_pins
(
pins
);
lf_rwlock_by_pins
(
pins
);
...
...
storage/maria/lockman.h
View file @
a9d5a3ff
...
@@ -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
lock
man_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
lock
man_lock
_type
lock
);
int
lockman_release_locks
(
LOCKMAN
*
,
LOCK_OWNER
*
);
int
lockman_release_locks
(
LOCKMAN
*
,
LOCK_OWNER
*
);
#ifdef EXTRA_DEBUG
#ifdef EXTRA_DEBUG
...
...
storage/maria/tablockman.c
View file @
a9d5a3ff
...
@@ -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
lock
man_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
lock
man_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
lock
man_lock
_type
new_lock
;
enum
lockman_getlock_result
res
;
enum
lockman_getlock_result
res
;
int
i
;
int
i
;
...
...
storage/maria/tablockman.h
View file @
a9d5a3ff
...
@@ -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
lock
man_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
lock
man_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
*
);
...
...
storage/maria/unittest/lockman-t.c
View file @
a9d5a3ff
...
@@ -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
lock
man_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"
,
...
...
storage/maria/unittest/lockman1-t.c
View file @
a9d5a3ff
...
@@ -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
lock
man_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"
,
...
...
storage/maria/unittest/lockman2-t.c
View file @
a9d5a3ff
...
@@ -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
lock
man_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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment