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
b04cffec
Commit
b04cffec
authored
May 20, 2009
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Add missing function comments.
parent
62718d0e
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
149 additions
and
92 deletions
+149
-92
handler/ha_innodb.cc
handler/ha_innodb.cc
+12
-9
include/data0type.h
include/data0type.h
+7
-3
include/data0type.ic
include/data0type.ic
+7
-3
include/dict0dict.h
include/dict0dict.h
+6
-2
include/dict0dict.ic
include/dict0dict.ic
+6
-2
include/ha_prototypes.h
include/ha_prototypes.h
+12
-9
include/os0proc.h
include/os0proc.h
+1
-0
include/os0thread.h
include/os0thread.h
+3
-2
include/row0mysql.h
include/row0mysql.h
+6
-2
include/row0sel.h
include/row0sel.h
+3
-2
include/sync0rw.h
include/sync0rw.h
+22
-11
include/sync0rw.ic
include/sync0rw.ic
+28
-35
include/sync0sync.h
include/sync0sync.h
+6
-1
include/ut0ut.h
include/ut0ut.h
+1
-0
lock/lock0lock.c
lock/lock0lock.c
+1
-0
log/log0log.c
log/log0log.c
+1
-0
os/os0proc.c
os/os0proc.c
+1
-0
os/os0thread.c
os/os0thread.c
+3
-1
page/page0zip.c
page/page0zip.c
+5
-5
row/row0mysql.c
row/row0mysql.c
+6
-2
srv/srv0start.c
srv/srv0start.c
+3
-1
sync/sync0rw.c
sync/sync0rw.c
+3
-1
sync/sync0sync.c
sync/sync0sync.c
+4
-1
trx/trx0roll.c
trx/trx0roll.c
+1
-0
ut/ut0ut.c
ut/ut0ut.c
+1
-0
No files found.
handler/ha_innodb.cc
View file @
b04cffec
...
@@ -1113,19 +1113,22 @@ innobase_mysql_tmpfile(void)
...
@@ -1113,19 +1113,22 @@ innobase_mysql_tmpfile(void)
#endif
/* defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) */
#endif
/* defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) */
/*************************************************************************
/*************************************************************************
Wrapper around MySQL's copy_and_convert function, see it for
Wrapper around MySQL's copy_and_convert function. */
documentation. */
extern
"C"
UNIV_INTERN
extern
"C"
UNIV_INTERN
ulint
ulint
innobase_convert_string
(
innobase_convert_string
(
/*====================*/
/*====================*/
void
*
to
,
/* out: number of bytes copied
ulint
to_length
,
to 'to' */
CHARSET_INFO
*
to_cs
,
void
*
to
,
/* out: converted string */
const
void
*
from
,
ulint
to_length
,
/* in: number of bytes reserved
ulint
from_length
,
for the converted string */
CHARSET_INFO
*
from_cs
,
CHARSET_INFO
*
to_cs
,
/* in: character set to convert to */
uint
*
errors
)
const
void
*
from
,
/* in: string to convert */
ulint
from_length
,
/* in: number of bytes to convert */
CHARSET_INFO
*
from_cs
,
/* in: character set to convert from */
uint
*
errors
)
/* out: number of errors encountered
during the conversion */
{
{
return
(
copy_and_convert
((
char
*
)
to
,
(
uint32
)
to_length
,
to_cs
,
return
(
copy_and_convert
((
char
*
)
to
,
(
uint32
)
to_length
,
to_cs
,
(
const
char
*
)
from
,
(
uint32
)
from_length
,
from_cs
,
(
const
char
*
)
from
,
(
uint32
)
from_length
,
from_cs
,
...
...
include/data0type.h
View file @
b04cffec
...
@@ -255,14 +255,16 @@ UNIV_INLINE
...
@@ -255,14 +255,16 @@ UNIV_INLINE
ulint
ulint
dtype_get_mtype
(
dtype_get_mtype
(
/*============*/
/*============*/
const
dtype_t
*
type
);
/* out: SQL main data type */
const
dtype_t
*
type
);
/* in: data type */
/*************************************************************************
/*************************************************************************
Gets the precise data type. */
Gets the precise data type. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
dtype_get_prtype
(
dtype_get_prtype
(
/*=============*/
/*=============*/
const
dtype_t
*
type
);
/* out: precise data type */
const
dtype_t
*
type
);
/* in: data type */
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
/*************************************************************************
/*************************************************************************
Compute the mbminlen and mbmaxlen members of a data type structure. */
Compute the mbminlen and mbmaxlen members of a data type structure. */
...
@@ -310,7 +312,9 @@ UNIV_INLINE
...
@@ -310,7 +312,9 @@ UNIV_INLINE
ulint
ulint
dtype_get_len
(
dtype_get_len
(
/*==========*/
/*==========*/
const
dtype_t
*
type
);
/* out: fixed length of the type, in bytes,
or 0 if variable-length */
const
dtype_t
*
type
);
/* in: data type */
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
/*************************************************************************
/*************************************************************************
Gets the minimum length of a character, in bytes. */
Gets the minimum length of a character, in bytes. */
...
...
include/data0type.ic
View file @
b04cffec
...
@@ -161,7 +161,8 @@ UNIV_INLINE
...
@@ -161,7 +161,8 @@ UNIV_INLINE
ulint
ulint
dtype_get_mtype(
dtype_get_mtype(
/*============*/
/*============*/
const dtype_t* type)
/* out: SQL main data type */
const dtype_t* type) /* in: data type */
{
{
ut_ad(type);
ut_ad(type);
...
@@ -174,7 +175,8 @@ UNIV_INLINE
...
@@ -174,7 +175,8 @@ UNIV_INLINE
ulint
ulint
dtype_get_prtype(
dtype_get_prtype(
/*=============*/
/*=============*/
const dtype_t* type)
/* out: precise data type */
const dtype_t* type) /* in: data type */
{
{
ut_ad(type);
ut_ad(type);
...
@@ -187,7 +189,9 @@ UNIV_INLINE
...
@@ -187,7 +189,9 @@ UNIV_INLINE
ulint
ulint
dtype_get_len(
dtype_get_len(
/*==========*/
/*==========*/
const dtype_t* type)
/* out: fixed length of the type, in bytes,
or 0 if variable-length */
const dtype_t* type) /* in: data type */
{
{
ut_ad(type);
ut_ad(type);
...
...
include/dict0dict.h
View file @
b04cffec
...
@@ -164,7 +164,9 @@ UNIV_INLINE
...
@@ -164,7 +164,9 @@ UNIV_INLINE
ulint
ulint
dict_col_get_no
(
dict_col_get_no
(
/*============*/
/*============*/
const
dict_col_t
*
col
);
/* out: col->ind, table column
position (starting from 0) */
const
dict_col_t
*
col
);
/* in: column */
/*************************************************************************
/*************************************************************************
Gets the column position in the clustered index. */
Gets the column position in the clustered index. */
UNIV_INLINE
UNIV_INLINE
...
@@ -915,7 +917,9 @@ UNIV_INLINE
...
@@ -915,7 +917,9 @@ UNIV_INLINE
const
dict_col_t
*
const
dict_col_t
*
dict_field_get_col
(
dict_field_get_col
(
/*===============*/
/*===============*/
const
dict_field_t
*
field
);
/* out: field->col,
pointer to the table column */
const
dict_field_t
*
field
);
/* in: index field */
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
/**************************************************************************
/**************************************************************************
Returns an index object if it is found in the dictionary cache.
Returns an index object if it is found in the dictionary cache.
...
...
include/dict0dict.ic
View file @
b04cffec
...
@@ -131,7 +131,9 @@ UNIV_INLINE
...
@@ -131,7 +131,9 @@ UNIV_INLINE
ulint
ulint
dict_col_get_no(
dict_col_get_no(
/*============*/
/*============*/
const dict_col_t* col)
/* out: col->ind, table column
position (starting from 0) */
const dict_col_t* col) /* in: column */
{
{
ut_ad(col);
ut_ad(col);
...
@@ -590,7 +592,9 @@ UNIV_INLINE
...
@@ -590,7 +592,9 @@ UNIV_INLINE
const dict_col_t*
const dict_col_t*
dict_field_get_col(
dict_field_get_col(
/*===============*/
/*===============*/
const dict_field_t* field)
/* out: field->col,
pointer to the table column */
const dict_field_t* field) /* in: index field */
{
{
ut_ad(field);
ut_ad(field);
...
...
include/ha_prototypes.h
View file @
b04cffec
...
@@ -26,19 +26,22 @@ Place, Suite 330, Boston, MA 02111-1307 USA
...
@@ -26,19 +26,22 @@ Place, Suite 330, Boston, MA 02111-1307 USA
InnoDB's C-code. */
InnoDB's C-code. */
/*************************************************************************
/*************************************************************************
Wrapper around MySQL's copy_and_convert function, see it for
Wrapper around MySQL's copy_and_convert function. */
documentation. */
UNIV_INTERN
UNIV_INTERN
ulint
ulint
innobase_convert_string
(
innobase_convert_string
(
/*====================*/
/*====================*/
void
*
to
,
/* out: number of bytes copied
ulint
to_length
,
to 'to' */
CHARSET_INFO
*
to_cs
,
void
*
to
,
/* out: converted string */
const
void
*
from
,
ulint
to_length
,
/* in: number of bytes reserved
ulint
from_length
,
for the converted string */
CHARSET_INFO
*
from_cs
,
CHARSET_INFO
*
to_cs
,
/* in: character set to convert to */
uint
*
errors
);
const
void
*
from
,
/* in: string to convert */
ulint
from_length
,
/* in: number of bytes to convert */
CHARSET_INFO
*
from_cs
,
/* in: character set to convert from */
uint
*
errors
);
/* out: number of errors encountered
during the conversion */
/***********************************************************************
/***********************************************************************
Formats the raw data in "data" (in InnoDB on-disk format) that is of
Formats the raw data in "data" (in InnoDB on-disk format) that is of
...
...
include/os0proc.h
View file @
b04cffec
...
@@ -49,6 +49,7 @@ UNIV_INTERN
...
@@ -49,6 +49,7 @@ UNIV_INTERN
ulint
ulint
os_proc_get_number
(
void
);
os_proc_get_number
(
void
);
/*====================*/
/*====================*/
/* out: process id as a number */
/********************************************************************
/********************************************************************
Allocates large pages memory. */
Allocates large pages memory. */
UNIV_INTERN
UNIV_INTERN
...
...
include/os0thread.h
View file @
b04cffec
...
@@ -71,8 +71,8 @@ UNIV_INTERN
...
@@ -71,8 +71,8 @@ UNIV_INTERN
ulint
ulint
os_thread_pf
(
os_thread_pf
(
/*=========*/
/*=========*/
/* out:
unsigned long int
*/
/* out:
thread identifier as a number
*/
os_thread_id_t
a
);
/* in:
thread or thread id
*/
os_thread_id_t
a
);
/* in:
OS thread identifier
*/
/********************************************************************
/********************************************************************
Creates a new thread of execution. The execution starts from
Creates a new thread of execution. The execution starts from
the function given. The start function takes a void* parameter
the function given. The start function takes a void* parameter
...
@@ -152,6 +152,7 @@ UNIV_INTERN
...
@@ -152,6 +152,7 @@ UNIV_INTERN
ulint
ulint
os_thread_get_last_error
(
void
);
os_thread_get_last_error
(
void
);
/*==========================*/
/*==========================*/
/* out: last error on Windows, 0 otherwise */
#ifndef UNIV_NONINL
#ifndef UNIV_NONINL
#include "os0thread.ic"
#include "os0thread.ic"
...
...
include/row0mysql.h
View file @
b04cffec
...
@@ -249,7 +249,9 @@ UNIV_INTERN
...
@@ -249,7 +249,9 @@ UNIV_INTERN
ibool
ibool
row_table_got_default_clust_index
(
row_table_got_default_clust_index
(
/*==============================*/
/*==============================*/
const
dict_table_t
*
table
);
/* out: TRUE if the clustered index
was generated automatically */
const
dict_table_t
*
table
);
/* in: table */
/*************************************************************************
/*************************************************************************
Calculates the key number used inside MySQL for an Innobase index. We have
Calculates the key number used inside MySQL for an Innobase index. We have
to take into account if we generated a default clustered index for the table */
to take into account if we generated a default clustered index for the table */
...
@@ -257,7 +259,9 @@ UNIV_INTERN
...
@@ -257,7 +259,9 @@ UNIV_INTERN
ulint
ulint
row_get_mysql_key_number_for_index
(
row_get_mysql_key_number_for_index
(
/*===============================*/
/*===============================*/
const
dict_index_t
*
index
);
/* out: the key number used
inside MySQL */
const
dict_index_t
*
index
);
/* in: index */
/*************************************************************************
/*************************************************************************
Does an update or delete of a row for MySQL. */
Does an update or delete of a row for MySQL. */
UNIV_INTERN
UNIV_INTERN
...
...
include/row0sel.h
View file @
b04cffec
...
@@ -67,8 +67,9 @@ UNIV_INLINE
...
@@ -67,8 +67,9 @@ UNIV_INLINE
plan_t
*
plan_t
*
sel_node_get_nth_plan
(
sel_node_get_nth_plan
(
/*==================*/
/*==================*/
sel_node_t
*
node
,
/* out: plan node */
ulint
i
);
sel_node_t
*
node
,
/* in: select node */
ulint
i
);
/* in: get ith plan node */
/**************************************************************************
/**************************************************************************
Performs a select step. This is a high-level function used in SQL execution
Performs a select step. This is a high-level function used in SQL execution
graphs. */
graphs. */
...
...
include/sync0rw.h
View file @
b04cffec
...
@@ -141,7 +141,8 @@ UNIV_INTERN
...
@@ -141,7 +141,8 @@ UNIV_INTERN
ibool
ibool
rw_lock_validate
(
rw_lock_validate
(
/*=============*/
/*=============*/
rw_lock_t
*
lock
);
/* out: TRUE */
rw_lock_t
*
lock
);
/* in: rw-lock */
#endif
/* UNIV_DEBUG */
#endif
/* UNIV_DEBUG */
/******************************************************************
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
NOTE! The following macros should be used in rw s-locking, not the
...
@@ -356,25 +357,34 @@ UNIV_INLINE
...
@@ -356,25 +357,34 @@ UNIV_INLINE
ulint
ulint
rw_lock_get_x_lock_count
(
rw_lock_get_x_lock_count
(
/*=====================*/
/*=====================*/
/* out: value of writer_count */
/* out: value of writer_count */
rw_lock_t
*
lock
);
/* in: rw-lock */
const
rw_lock_t
*
lock
);
/* in: rw-lock */
/************************************************************************
/************************************************************************
Accessor functions for rw
lock. */
Check if there are threads waiting for the rw-
lock. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
rw_lock_get_waiters
(
rw_lock_get_waiters
(
/*================*/
/*================*/
rw_lock_t
*
lock
);
/* out: 1 if waiters, 0 otherwise */
const
rw_lock_t
*
lock
);
/* in: rw-lock */
/**********************************************************************
Returns the write-status of the lock - this function made more sense
with the old rw_lock implementation. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
rw_lock_get_writer
(
rw_lock_get_writer
(
/*===============*/
/*===============*/
rw_lock_t
*
lock
);
/* out: RW_LOCK_NOT_LOCKED,
RW_LOCK_EX, RW_LOCK_WAIT_EX */
const
rw_lock_t
*
lock
);
/* in: rw-lock */
/**********************************************************************
Returns the number of readers. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
rw_lock_get_reader_count
(
rw_lock_get_reader_count
(
/*=====================*/
/*=====================*/
rw_lock_t
*
lock
);
/* out: number of readers */
const
rw_lock_t
*
lock
);
/* in: rw-lock */
/**********************************************************************
/**********************************************************************
Decrements lock_word the specified amount if it is greater than 0.
Decrements lock_word the specified amount if it is greater than 0.
This is used by both s_lock and x_lock operations. */
This is used by both s_lock and x_lock operations. */
...
@@ -383,7 +393,7 @@ ibool
...
@@ -383,7 +393,7 @@ ibool
rw_lock_lock_word_decr
(
rw_lock_lock_word_decr
(
/*===================*/
/*===================*/
/* out: TRUE if decr occurs */
/* out: TRUE if decr occurs */
rw_lock_t
*
lock
,
/* in: rw-lock */
rw_lock_t
*
lock
,
/* in
/out
: rw-lock */
ulint
amount
);
/* in: amount to decrement */
ulint
amount
);
/* in: amount to decrement */
/**********************************************************************
/**********************************************************************
Increments lock_word the specified amount and returns new value. */
Increments lock_word the specified amount and returns new value. */
...
@@ -391,9 +401,10 @@ UNIV_INLINE
...
@@ -391,9 +401,10 @@ UNIV_INLINE
lint
lint
rw_lock_lock_word_incr
(
rw_lock_lock_word_incr
(
/*===================*/
/*===================*/
/* out: TRUE if decr occurs */
/* out: lock->lock_word after
rw_lock_t
*
lock
,
increment */
ulint
amount
);
/* in: rw-lock */
rw_lock_t
*
lock
,
/* in/out: rw-lock */
ulint
amount
);
/* in: amount to increment */
/**********************************************************************
/**********************************************************************
This function sets the lock->writer_thread and lock->recursive fields.
This function sets the lock->writer_thread and lock->recursive fields.
For platforms where we are using atomic builtins instead of lock->mutex
For platforms where we are using atomic builtins instead of lock->mutex
...
...
include/sync0rw.ic
View file @
b04cffec
...
@@ -67,13 +67,13 @@ rw_lock_remove_debug_info(
...
@@ -67,13 +67,13 @@ rw_lock_remove_debug_info(
#endif /* UNIV_SYNC_DEBUG */
#endif /* UNIV_SYNC_DEBUG */
/************************************************************************
/************************************************************************
Accessor functions for rw
lock. */
Check if there are threads waiting for the rw-
lock. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
rw_lock_get_waiters(
rw_lock_get_waiters(
/*================*/
/*================*/
/* out: 1 if waiters, 0 otherwise */
/* out: 1 if waiters, 0 otherwise */
rw_lock_t* lock) /* in: rw-lock */
const
rw_lock_t* lock) /* in: rw-lock */
{
{
return(lock->waiters);
return(lock->waiters);
}
}
...
@@ -86,7 +86,7 @@ UNIV_INLINE
...
@@ -86,7 +86,7 @@ UNIV_INLINE
void
void
rw_lock_set_waiter_flag(
rw_lock_set_waiter_flag(
/*====================*/
/*====================*/
rw_lock_t* lock) /* in: rw-lock */
rw_lock_t* lock) /* in
/out
: rw-lock */
{
{
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
os_compare_and_swap_ulint(&lock->waiters, 0, 1);
os_compare_and_swap_ulint(&lock->waiters, 0, 1);
...
@@ -103,7 +103,7 @@ UNIV_INLINE
...
@@ -103,7 +103,7 @@ UNIV_INLINE
void
void
rw_lock_reset_waiter_flag(
rw_lock_reset_waiter_flag(
/*======================*/
/*======================*/
rw_lock_t* lock) /* in: rw-lock */
rw_lock_t* lock) /* in
/out
: rw-lock */
{
{
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
os_compare_and_swap_ulint(&lock->waiters, 1, 0);
os_compare_and_swap_ulint(&lock->waiters, 1, 0);
...
@@ -119,10 +119,12 @@ UNIV_INLINE
...
@@ -119,10 +119,12 @@ UNIV_INLINE
ulint
ulint
rw_lock_get_writer(
rw_lock_get_writer(
/*===============*/
/*===============*/
rw_lock_t* lock)
/* out: RW_LOCK_NOT_LOCKED,
RW_LOCK_EX, RW_LOCK_WAIT_EX */
const rw_lock_t* lock) /* in: rw-lock */
{
{
lint lock_word = lock->lock_word;
lint lock_word = lock->lock_word;
if(lock_word > 0) {
if
(lock_word > 0) {
/* return NOT_LOCKED in s-lock state, like the writer
/* return NOT_LOCKED in s-lock state, like the writer
member of the old lock implementation. */
member of the old lock implementation. */
return(RW_LOCK_NOT_LOCKED);
return(RW_LOCK_NOT_LOCKED);
...
@@ -135,15 +137,16 @@ rw_lock_get_writer(
...
@@ -135,15 +137,16 @@ rw_lock_get_writer(
}
}
/**********************************************************************
/**********************************************************************
Returns number of readers. */
Returns
the
number of readers. */
UNIV_INLINE
UNIV_INLINE
ulint
ulint
rw_lock_get_reader_count(
rw_lock_get_reader_count(
/*=====================*/
/*=====================*/
rw_lock_t* lock)
/* out: number of readers */
const rw_lock_t* lock) /* in: rw-lock */
{
{
lint lock_word = lock->lock_word;
lint lock_word = lock->lock_word;
if(lock_word > 0) {
if
(lock_word > 0) {
/* s-locked, no x-waiters */
/* s-locked, no x-waiters */
return(X_LOCK_DECR - lock_word);
return(X_LOCK_DECR - lock_word);
} else if (lock_word < 0 && lock_word > -X_LOCK_DECR) {
} else if (lock_word < 0 && lock_word > -X_LOCK_DECR) {
...
@@ -171,12 +174,12 @@ UNIV_INLINE
...
@@ -171,12 +174,12 @@ UNIV_INLINE
ulint
ulint
rw_lock_get_x_lock_count(
rw_lock_get_x_lock_count(
/*=====================*/
/*=====================*/
/* out: value of writer_count */
/* out: value of writer_count */
rw_lock_t* lock) /* in: rw-lock */
const
rw_lock_t* lock) /* in: rw-lock */
{
{
lint lock_copy = lock->lock_word;
lint lock_copy = lock->lock_word;
/* If there is a reader, lock_word is not divisible by X_LOCK_DECR */
/* If there is a reader, lock_word is not divisible by X_LOCK_DECR */
if(lock_copy > 0 || (-lock_copy) % X_LOCK_DECR != 0) {
if
(lock_copy > 0 || (-lock_copy) % X_LOCK_DECR != 0) {
return(0);
return(0);
}
}
return(((-lock_copy) / X_LOCK_DECR) + 1);
return(((-lock_copy) / X_LOCK_DECR) + 1);
...
@@ -192,56 +195,47 @@ UNIV_INLINE
...
@@ -192,56 +195,47 @@ UNIV_INLINE
ibool
ibool
rw_lock_lock_word_decr(
rw_lock_lock_word_decr(
/*===================*/
/*===================*/
/* out: TRUE if decr occurs */
/* out: TRUE if decr occurs */
rw_lock_t* lock,
/* in
: rw-lock */
rw_lock_t* lock,
/* in/out
: rw-lock */
ulint amount)
/* in: amount of
decrement */
ulint amount)
; /* in: amount to
decrement */
{
{
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
lint local_lock_word = lock->lock_word;
lint local_lock_word = lock->lock_word;
while (local_lock_word > 0) {
while (local_lock_word > 0) {
if(os_compare_and_swap_lint(&lock->lock_word,
if
(os_compare_and_swap_lint(&lock->lock_word,
local_lock_word,
local_lock_word,
local_lock_word - amount)) {
local_lock_word - amount)) {
return(TRUE);
return(TRUE);
}
}
local_lock_word = lock->lock_word;
local_lock_word = lock->lock_word;
}
}
return(FALSE);
return(FALSE);
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
ibool success = FALSE;
ibool success = FALSE;
mutex_enter(&(lock->mutex));
mutex_enter(&(lock->mutex));
if(lock->lock_word > 0) {
if
(lock->lock_word > 0) {
lock->lock_word -= amount;
lock->lock_word -= amount;
success = TRUE;
success = TRUE;
}
}
mutex_exit(&(lock->mutex));
mutex_exit(&(lock->mutex));
return(success);
return(success);
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
}
}
/**********************************************************************
/**********************************************************************
Two different implementations for incrementing the lock_word of a rw_lock:
Increments lock_word the specified amount and returns new value. */
one for systems supporting atomic operations, one for others.
Returns the value of lock_word after increment. */
UNIV_INLINE
UNIV_INLINE
lint
lint
rw_lock_lock_word_incr(
rw_lock_lock_word_incr(
/*===================*/
/*===================*/
/* out: lock->lock_word after increment */
/* out: lock->lock_word after
rw_lock_t* lock, /* in: rw-lock */
increment */
ulint amount) /* in: amount of increment */
rw_lock_t* lock, /* in/out: rw-lock */
ulint amount) /* in: amount of increment */
{
{
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
return(os_atomic_increment_lint(&lock->lock_word, amount));
return(os_atomic_increment_lint(&lock->lock_word, amount));
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
lint local_lock_word;
lint local_lock_word;
mutex_enter(&(lock->mutex));
mutex_enter(&(lock->mutex));
...
@@ -252,7 +246,6 @@ rw_lock_lock_word_incr(
...
@@ -252,7 +246,6 @@ rw_lock_lock_word_incr(
mutex_exit(&(lock->mutex));
mutex_exit(&(lock->mutex));
return(local_lock_word);
return(local_lock_word);
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
}
}
...
...
include/sync0sync.h
View file @
b04cffec
...
@@ -160,6 +160,7 @@ void
...
@@ -160,6 +160,7 @@ void
mutex_exit
(
mutex_exit
(
/*=======*/
/*=======*/
mutex_t
*
mutex
);
/* in: pointer to mutex */
mutex_t
*
mutex
);
/* in: pointer to mutex */
#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
/**********************************************************************
Returns TRUE if no mutex or rw-lock is currently locked.
Returns TRUE if no mutex or rw-lock is currently locked.
Works only in the debug version. */
Works only in the debug version. */
...
@@ -167,6 +168,8 @@ UNIV_INTERN
...
@@ -167,6 +168,8 @@ UNIV_INTERN
ibool
ibool
sync_all_freed
(
void
);
sync_all_freed
(
void
);
/*================*/
/*================*/
/* out: TRUE if no mutexes and rw-locks reserved */
#endif
/* UNIV_SYNC_DEBUG */
/*#####################################################################
/*#####################################################################
FUNCTION PROTOTYPES FOR DEBUGGING */
FUNCTION PROTOTYPES FOR DEBUGGING */
/***********************************************************************
/***********************************************************************
...
@@ -190,7 +193,8 @@ UNIV_INTERN
...
@@ -190,7 +193,8 @@ UNIV_INTERN
ibool
ibool
mutex_validate
(
mutex_validate
(
/*===========*/
/*===========*/
const
mutex_t
*
mutex
);
/* out: TRUE */
const
mutex_t
*
mutex
);
/* in: mutex */
/**********************************************************************
/**********************************************************************
Checks that the current thread owns the mutex. Works only
Checks that the current thread owns the mutex. Works only
in the debug version. */
in the debug version. */
...
@@ -260,6 +264,7 @@ UNIV_INTERN
...
@@ -260,6 +264,7 @@ UNIV_INTERN
ulint
ulint
mutex_n_reserved
(
void
);
mutex_n_reserved
(
void
);
/*==================*/
/*==================*/
/* out: number of reserved mutexes */
#endif
/* UNIV_SYNC_DEBUG */
#endif
/* UNIV_SYNC_DEBUG */
/**********************************************************************
/**********************************************************************
NOT to be used outside this module except in debugging! Gets the value
NOT to be used outside this module except in debugging! Gets the value
...
...
include/ut0ut.h
View file @
b04cffec
...
@@ -165,6 +165,7 @@ UNIV_INTERN
...
@@ -165,6 +165,7 @@ UNIV_INTERN
ib_time_t
ib_time_t
ut_time
(
void
);
ut_time
(
void
);
/*=========*/
/*=========*/
/* out: system time */
/**************************************************************
/**************************************************************
Returns system time.
Returns system time.
Upon successful completion, the value 0 is returned; otherwise the
Upon successful completion, the value 0 is returned; otherwise the
...
...
lock/lock0lock.c
View file @
b04cffec
...
@@ -4343,6 +4343,7 @@ static
...
@@ -4343,6 +4343,7 @@ static
ulint
ulint
lock_get_n_rec_locks
(
void
)
lock_get_n_rec_locks
(
void
)
/*======================*/
/*======================*/
/* out: number of record locks */
{
{
lock_t
*
lock
;
lock_t
*
lock
;
ulint
n_locks
=
0
;
ulint
n_locks
=
0
;
...
...
log/log0log.c
View file @
b04cffec
...
@@ -177,6 +177,7 @@ static
...
@@ -177,6 +177,7 @@ static
ib_uint64_t
ib_uint64_t
log_buf_pool_get_oldest_modification
(
void
)
log_buf_pool_get_oldest_modification
(
void
)
/*======================================*/
/*======================================*/
/* out: LSN of oldest modification */
{
{
ib_uint64_t
lsn
;
ib_uint64_t
lsn
;
...
...
os/os0proc.c
View file @
b04cffec
...
@@ -52,6 +52,7 @@ UNIV_INTERN
...
@@ -52,6 +52,7 @@ UNIV_INTERN
ulint
ulint
os_proc_get_number
(
void
)
os_proc_get_number
(
void
)
/*====================*/
/*====================*/
/* out: process id as a number */
{
{
#ifdef __WIN__
#ifdef __WIN__
return
((
ulint
)
GetCurrentProcessId
());
return
((
ulint
)
GetCurrentProcessId
());
...
...
os/os0thread.c
View file @
b04cffec
...
@@ -67,7 +67,8 @@ UNIV_INTERN
...
@@ -67,7 +67,8 @@ UNIV_INTERN
ulint
ulint
os_thread_pf
(
os_thread_pf
(
/*=========*/
/*=========*/
os_thread_id_t
a
)
/* out: thread identifier as a number */
os_thread_id_t
a
)
/* in: OS thread identifier */
{
{
#ifdef UNIV_HPUX10
#ifdef UNIV_HPUX10
/* In HP-UX-10.20 a pthread_t is a struct of 3 fields: field1, field2,
/* In HP-UX-10.20 a pthread_t is a struct of 3 fields: field1, field2,
...
@@ -361,6 +362,7 @@ UNIV_INTERN
...
@@ -361,6 +362,7 @@ UNIV_INTERN
ulint
ulint
os_thread_get_last_error
(
void
)
os_thread_get_last_error
(
void
)
/*==========================*/
/*==========================*/
/* out: last error on Windows, 0 otherwise */
{
{
#ifdef __WIN__
#ifdef __WIN__
return
(
GetLastError
());
return
(
GetLastError
());
...
...
page/page0zip.c
View file @
b04cffec
...
@@ -651,9 +651,9 @@ static
...
@@ -651,9 +651,9 @@ static
void
*
void
*
page_zip_malloc
(
page_zip_malloc
(
/*============*/
/*============*/
void
*
opaque
,
void
*
opaque
,
/* in/out: memory heap */
uInt
items
,
uInt
items
,
/* in: number of items to allocate */
uInt
size
)
uInt
size
)
/* in: size of an item in bytes */
{
{
return
(
mem_heap_alloc
(
opaque
,
items
*
size
));
return
(
mem_heap_alloc
(
opaque
,
items
*
size
));
}
}
...
@@ -664,8 +664,8 @@ static
...
@@ -664,8 +664,8 @@ static
void
void
page_zip_free
(
page_zip_free
(
/*==========*/
/*==========*/
void
*
opaque
__attribute__
((
unused
)),
void
*
opaque
__attribute__
((
unused
)),
/* in: memory heap */
void
*
address
__attribute__
((
unused
)))
void
*
address
__attribute__
((
unused
)))
/* in: object to free */
{
{
}
}
...
...
row/row0mysql.c
View file @
b04cffec
...
@@ -1616,7 +1616,9 @@ UNIV_INTERN
...
@@ -1616,7 +1616,9 @@ UNIV_INTERN
ibool
ibool
row_table_got_default_clust_index
(
row_table_got_default_clust_index
(
/*==============================*/
/*==============================*/
const
dict_table_t
*
table
)
/* out: TRUE if the clustered index
was generated automatically */
const
dict_table_t
*
table
)
/* in: table */
{
{
const
dict_index_t
*
clust_index
;
const
dict_index_t
*
clust_index
;
...
@@ -1632,7 +1634,9 @@ UNIV_INTERN
...
@@ -1632,7 +1634,9 @@ UNIV_INTERN
ulint
ulint
row_get_mysql_key_number_for_index
(
row_get_mysql_key_number_for_index
(
/*===============================*/
/*===============================*/
const
dict_index_t
*
index
)
/* out: the key number used
inside MySQL */
const
dict_index_t
*
index
)
/* in: index */
{
{
const
dict_index_t
*
ind
;
const
dict_index_t
*
ind
;
ulint
i
;
ulint
i
;
...
...
srv/srv0start.c
View file @
b04cffec
...
@@ -444,7 +444,9 @@ static
...
@@ -444,7 +444,9 @@ static
os_thread_ret_t
os_thread_ret_t
io_handler_thread
(
io_handler_thread
(
/*==============*/
/*==============*/
void
*
arg
)
/* out: OS_THREAD_DUMMY_RETURN */
void
*
arg
)
/* in: pointer to the number of the segment in
the aio array */
{
{
ulint
segment
;
ulint
segment
;
ulint
i
;
ulint
i
;
...
...
sync/sync0rw.c
View file @
b04cffec
...
@@ -194,6 +194,7 @@ static
...
@@ -194,6 +194,7 @@ static
rw_lock_debug_t
*
rw_lock_debug_t
*
rw_lock_debug_create
(
void
)
rw_lock_debug_create
(
void
)
/*======================*/
/*======================*/
/* out, own: debug info struct */
{
{
return
((
rw_lock_debug_t
*
)
mem_alloc
(
sizeof
(
rw_lock_debug_t
)));
return
((
rw_lock_debug_t
*
)
mem_alloc
(
sizeof
(
rw_lock_debug_t
)));
}
}
...
@@ -329,7 +330,8 @@ UNIV_INTERN
...
@@ -329,7 +330,8 @@ UNIV_INTERN
ibool
ibool
rw_lock_validate
(
rw_lock_validate
(
/*=============*/
/*=============*/
rw_lock_t
*
lock
)
/* out: TRUE */
rw_lock_t
*
lock
)
/* in: rw-lock */
{
{
ut_a
(
lock
);
ut_a
(
lock
);
...
...
sync/sync0sync.c
View file @
b04cffec
...
@@ -374,7 +374,8 @@ UNIV_INTERN
...
@@ -374,7 +374,8 @@ UNIV_INTERN
ibool
ibool
mutex_validate
(
mutex_validate
(
/*===========*/
/*===========*/
const
mutex_t
*
mutex
)
/* out: TRUE */
const
mutex_t
*
mutex
)
/* in: mutex */
{
{
ut_a
(
mutex
);
ut_a
(
mutex
);
ut_a
(
mutex
->
magic_n
==
MUTEX_MAGIC_N
);
ut_a
(
mutex
->
magic_n
==
MUTEX_MAGIC_N
);
...
@@ -703,6 +704,7 @@ UNIV_INTERN
...
@@ -703,6 +704,7 @@ UNIV_INTERN
ulint
ulint
mutex_n_reserved
(
void
)
mutex_n_reserved
(
void
)
/*==================*/
/*==================*/
/* out: number of reserved mutexes */
{
{
mutex_t
*
mutex
;
mutex_t
*
mutex
;
ulint
count
=
0
;
ulint
count
=
0
;
...
@@ -735,6 +737,7 @@ UNIV_INTERN
...
@@ -735,6 +737,7 @@ UNIV_INTERN
ibool
ibool
sync_all_freed
(
void
)
sync_all_freed
(
void
)
/*================*/
/*================*/
/* out: TRUE if no mutexes and rw-locks reserved */
{
{
return
(
mutex_n_reserved
()
+
rw_lock_n_locked
()
==
0
);
return
(
mutex_n_reserved
()
+
rw_lock_n_locked
()
==
0
);
}
}
...
...
trx/trx0roll.c
View file @
b04cffec
...
@@ -614,6 +614,7 @@ UNIV_INTERN
...
@@ -614,6 +614,7 @@ UNIV_INTERN
trx_undo_arr_t
*
trx_undo_arr_t
*
trx_undo_arr_create
(
void
)
trx_undo_arr_create
(
void
)
/*=====================*/
/*=====================*/
/* out, own: undo number array */
{
{
trx_undo_arr_t
*
arr
;
trx_undo_arr_t
*
arr
;
mem_heap_t
*
heap
;
mem_heap_t
*
heap
;
...
...
ut/ut0ut.c
View file @
b04cffec
...
@@ -116,6 +116,7 @@ UNIV_INTERN
...
@@ -116,6 +116,7 @@ UNIV_INTERN
ib_time_t
ib_time_t
ut_time
(
void
)
ut_time
(
void
)
/*=========*/
/*=========*/
/* out: system time */
{
{
return
(
time
(
NULL
));
return
(
time
(
NULL
));
}
}
...
...
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