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
80409986
Commit
80409986
authored
Nov 15, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16264: Fix some white space
parent
37f1ab23
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
145 deletions
+89
-145
storage/innobase/dict/dict0stats_bg.cc
storage/innobase/dict/dict0stats_bg.cc
+3
-9
storage/innobase/fts/fts0opt.cc
storage/innobase/fts/fts0opt.cc
+0
-3
storage/innobase/include/os0file.h
storage/innobase/include/os0file.h
+1
-2
storage/innobase/os/os0file.cc
storage/innobase/os/os0file.cc
+55
-84
tpool/aio_simulated.cc
tpool/aio_simulated.cc
+4
-4
tpool/tpool.h
tpool/tpool.h
+1
-1
tpool/tpool_generic.cc
tpool/tpool_generic.cc
+17
-17
tpool/tpool_structs.h
tpool/tpool_structs.h
+8
-25
No files found.
storage/innobase/dict/dict0stats_bg.cc
View file @
80409986
...
...
@@ -326,17 +326,11 @@ void dict_stats_deinit()
mutex_free
(
&
recalc_pool_mutex
);
}
/**
***************************************************************//**
/**
Get the first table that has been added for auto recalc and eventually
update its stats.
@return : true if pool was non-empty and first entry does
not needs delay, false otherwise.
*/
static
bool
dict_stats_process_entry_from_recalc_pool
()
/*=======================================*/
@return whether the first entry can be processed immediately */
static
bool
dict_stats_process_entry_from_recalc_pool
()
{
table_id_t
table_id
;
...
...
storage/innobase/fts/fts0opt.cc
View file @
80409986
...
...
@@ -49,9 +49,6 @@ static tpool::task task(fts_optimize_callback,0, &task_group);
/** The FTS vector to store fts_slot_t */
static
ib_vector_t
*
fts_slots
;
/** Time to wait for a message. */
static
const
ulint
FTS_QUEUE_WAIT_IN_USECS
=
5000000
;
/** Default optimize interval in secs. */
static
const
ulint
FTS_OPTIMIZE_INTERVAL_IN_SECS
=
300
;
...
...
storage/innobase/include/os0file.h
View file @
80409986
...
...
@@ -663,8 +663,7 @@ Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error.
@param[in] file own: handle to a file
@return true if success */
bool
os_file_close_func
(
os_file_t
file
);
bool
os_file_close_func
(
os_file_t
file
);
#ifdef UNIV_PFS_IO
...
...
storage/innobase/os/os0file.cc
View file @
80409986
...
...
@@ -78,7 +78,6 @@ Created 10/21/1995 Heikki Tuuri
#include <my_sys.h>
#endif
/* Per-IO operation environment*/
class
io_slots
{
...
...
@@ -281,59 +280,40 @@ os_win32_device_io_control(
/** Helper class for doing synchronous file IO. Currently, the objective
is to hide the OS specific code, so that the higher level functions aren't
peppered with #ifdef. Makes the code flow difficult to follow. */
class
SyncFileIO
{
class
SyncFileIO
{
public:
/** Constructor
@param[in] fh File handle
@param[in,out] buf Buffer to read/write
@param[in] n Number of bytes to read/write
@param[in] offset Offset where to read or write */
SyncFileIO
(
os_file_t
fh
,
void
*
buf
,
ulint
n
,
os_offset_t
offset
)
:
m_fh
(
fh
),
m_buf
(
buf
),
m_n
(
static_cast
<
ssize_t
>
(
n
)),
m_offset
(
offset
)
{
ut_ad
(
m_n
>
0
);
}
/** Destructor */
~
SyncFileIO
()
{
/* No op */
}
SyncFileIO
(
os_file_t
fh
,
void
*
buf
,
ulint
n
,
os_offset_t
offset
)
:
m_fh
(
fh
),
m_buf
(
buf
),
m_n
(
static_cast
<
ssize_t
>
(
n
)),
m_offset
(
offset
)
{
ut_ad
(
m_n
>
0
);
}
/** Do the read/write
@param[in] request The IO context and type
@return the number of bytes read/written or negative value on error */
ssize_t
execute
(
const
IORequest
&
request
);
ssize_t
execute
(
const
IORequest
&
request
);
/** Move the read/write offset up to where the partial IO succeeded.
@param[in] n_bytes The number of bytes to advance */
void
advance
(
ssize_t
n_bytes
)
{
m_offset
+=
n_bytes
;
m_offset
+=
n_bytes
;
ut_ad
(
m_n
>=
n_bytes
);
m_n
-=
n_bytes
;
m_buf
=
reinterpret_cast
<
uchar
*>
(
m_buf
)
+
n_bytes
;
m_n
-=
n_bytes
;
m_buf
=
reinterpret_cast
<
uchar
*>
(
m_buf
)
+
n_bytes
;
}
private:
/** Open file handle */
os_file_t
m_fh
;
const
os_file_t
m_fh
;
/** Buffer to read/write */
void
*
m_buf
;
void
*
m_buf
;
/** Number of bytes to read/write */
ssize_t
m_n
;
/** Offset from where to read/write */
os_offset_t
m_offset
;
};
...
...
@@ -1665,19 +1645,15 @@ Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error.
@param[in] file Handle to close
@return true if success */
bool
os_file_close_func
(
os_file_t
file
)
bool
os_file_close_func
(
os_file_t
file
)
{
int
ret
=
close
(
file
);
if
(
ret
==
-
1
)
{
os_file_handle_error
(
NULL
,
"close"
);
int
ret
=
close
(
file
);
return
(
false
);
}
if
(
!
ret
)
return
true
;
return
(
true
);
os_file_handle_error
(
NULL
,
"close"
);
return
false
;
}
/** Gets a file size.
...
...
@@ -2510,11 +2486,10 @@ os_file_create_func(
case
SRV_O_DIRECT_NO_FSYNC
:
case
SRV_O_DIRECT
:
if
(
type
==
OS_DATA_FILE
)
{
attributes
|=
FILE_FLAG_NO_BUFFERING
;
}
if
(
type
!=
OS_DATA_FILE
)
{
break
;
}
/* fall through */
case
SRV_ALL_O_DIRECT_FSYNC
:
/*Traditional Windows behavior, no buffering for any files.*/
attributes
|=
FILE_FLAG_NO_BUFFERING
;
...
...
@@ -2849,22 +2824,18 @@ Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error.
@param[in,own] file Handle to a file
@return true if success */
bool
os_file_close_func
(
os_file_t
file
)
bool
os_file_close_func
(
os_file_t
file
)
{
ut_a
(
file
!=
0
);
if
(
!
CloseHandle
(
file
))
{
ut_ad
(
file
);
if
(
!
CloseHandle
(
file
))
{
os_file_handle_error
(
NULL
,
"close"
);
return
false
;
}
if
(
srv_thread_pool
)
srv_thread_pool
->
unbind
(
file
);
return
(
true
);
return
true
;
}
/** Gets a file size.
...
...
tpool/aio_simulated.cc
View file @
80409986
...
...
@@ -31,7 +31,7 @@ namespace tpool
we use valid event handle for the hEvent member of the OVERLAPPED structure,
with its low-order bit set.
S
ee MSDN docs for GetQueuedCompletionStatus() for description of this trick.
See MSDN docs for GetQueuedCompletionStatus() for description of this trick.
*/
static
DWORD
fls_sync_io
=
FLS_OUT_OF_INDEXES
;
HANDLE
win_get_syncio_event
()
...
...
tpool/tpool.h
View file @
80409986
...
...
@@ -53,7 +53,7 @@ namespace tpool
typedef
void
(
*
callback_func
)(
void
*
);
class
task
;
/*
A class that can be used e.g for
/*
* A class that can be used e.g. for
restricting concurrency for specific class of tasks. */
class
task_group
...
...
tpool/tpool_generic.cc
View file @
80409986
...
...
@@ -162,26 +162,26 @@ class thread_pool_generic : public thread_pool
/** The task queue */
circular_queue
<
task
*>
m_task_queue
;
/*
List of standby (idle) workers.
*/
/*
* List of standby (idle) workers
*/
doubly_linked_list
<
worker_data
>
m_standby_threads
;
/** List of threads that are executing tasks
.
*/
/** List of threads that are executing tasks */
doubly_linked_list
<
worker_data
>
m_active_threads
;
/* Mutex that protects the whole struct, most importantly
the standby threads list, and task queue
.
*/
the standby threads list, and task queue */
std
::
mutex
m_mtx
;
/** Timeout after which idle worker shuts down
.
*/
/** Timeout after which idle worker shuts down
*/
std
::
chrono
::
milliseconds
m_thread_timeout
;
/** How often should timer wakeup.*/
std
::
chrono
::
milliseconds
m_timer_interval
;
/** Another condition variable, used in pool shutdown
-
*/
/** Another condition variable, used in pool shutdown
*/
std
::
condition_variable
m_cv_no_threads
;
/** Condition variable for the timer thread. Signaled on shutdown.*/
/** Condition variable for the timer thread. Signaled on shutdown.
*/
std
::
condition_variable
m_cv_timer
;
/** Overall number of enqueues*/
...
...
@@ -189,7 +189,7 @@ class thread_pool_generic : public thread_pool
/** Overall number of dequeued tasks. */
unsigned
long
long
m_tasks_dequeued
;
/**
Statistic related, number of worker thread wakeups.
*/
/**
Statistic related, number of worker thread wakeups
*/
int
m_wakeups
;
/**
...
...
@@ -198,7 +198,8 @@ class thread_pool_generic : public thread_pool
*/
int
m_spurious_wakeups
;
/** The desired concurrency. This number of workers should be actively executing.*/
/** The desired concurrency. This number of workers should be
actively executing. */
unsigned
int
m_concurrency
;
/** True, if threadpool is being shutdown, false otherwise */
...
...
@@ -387,9 +388,8 @@ void thread_pool_generic::cancel_pending(task* t)
/**
Register worker in standby list, and wait to be woken.
@return
true - thread was woken
false - idle wait timeout exceeded (the current thread need to shutdown)
@retval true if thread was woken
@retval false idle wait timeout exceeded (the current thread must shutdown)
*/
bool
thread_pool_generic
::
wait_for_tasks
(
std
::
unique_lock
<
std
::
mutex
>
&
lk
,
worker_data
*
thread_data
)
...
...
tpool/tpool_structs.h
View file @
80409986
...
...
@@ -199,44 +199,27 @@ template <typename T> class circular_queue
explicit
iterator
(
size_t
pos
,
circular_queue
<
T
>*
q
)
:
m_pos
(
pos
),
m_queue
(
q
)
{}
iterator
&
operator
++
()
{
m_pos
=
(
m_pos
+
1
)
%
m_queue
->
m_capacity
;
m_pos
=
(
m_pos
+
1
)
%
m_queue
->
m_capacity
;
return
*
this
;
}
iterator
operator
++
(
int
)
{
iterator
retval
=
*
this
;
++
(
*
this
);
iterator
retval
=
*
this
;
++
*
this
;
return
retval
;
}
bool
operator
==
(
iterator
other
)
const
{
return
m_pos
==
other
.
m_pos
;
}
bool
operator
!=
(
iterator
other
)
const
{
return
!
(
*
this
==
other
);
}
T
&
operator
*
()
const
{
return
m_queue
->
m_buffer
[
m_pos
];
}
bool
operator
==
(
iterator
other
)
const
{
return
m_pos
==
other
.
m_pos
;
}
bool
operator
!=
(
iterator
other
)
const
{
return
!
(
*
this
==
other
);
}
T
&
operator
*
()
const
{
return
m_queue
->
m_buffer
[
m_pos
];
}
};
iterator
begin
()
{
return
iterator
(
m_tail
,
this
);
}
iterator
end
()
{
return
iterator
(
m_head
,
this
);
}
iterator
begin
()
{
return
iterator
(
m_tail
,
this
);
}
iterator
end
()
{
return
iterator
(
m_head
,
this
);
}
private:
size_t
m_capacity
;
std
::
vector
<
T
>
m_buffer
;
size_t
m_head
;
size_t
m_tail
;
};
/* Doubly linked list. Intrusive,
...
...
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