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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0f0f9176
Commit
0f0f9176
authored
Jul 09, 2002
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
srv0srv.c:
Protect InnoDB monitor with a mutex
parent
d7871389
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
innobase/srv/srv0srv.c
innobase/srv/srv0srv.c
+8
-0
No files found.
innobase/srv/srv0srv.c
View file @
0f0f9176
...
@@ -274,6 +274,8 @@ char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS];
...
@@ -274,6 +274,8 @@ char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS];
time_t
srv_last_monitor_time
;
time_t
srv_last_monitor_time
;
mutex_t
srv_innodb_monitor_mutex
;
/*
/*
IMPLEMENTATION OF THE SERVER MAIN PROGRAM
IMPLEMENTATION OF THE SERVER MAIN PROGRAM
=========================================
=========================================
...
@@ -1619,6 +1621,9 @@ srv_init(void)
...
@@ -1619,6 +1621,9 @@ srv_init(void)
mutex_create
(
&
kernel_mutex
);
mutex_create
(
&
kernel_mutex
);
mutex_set_level
(
&
kernel_mutex
,
SYNC_KERNEL
);
mutex_set_level
(
&
kernel_mutex
,
SYNC_KERNEL
);
mutex_create
(
&
srv_innodb_monitor_mutex
);
mutex_set_level
(
&
srv_innodb_monitor_mutex
,
SYNC_NO_ORDER_CHECK
);
srv_sys
->
threads
=
mem_alloc
(
OS_THREAD_MAX_N
*
sizeof
(
srv_slot_t
));
srv_sys
->
threads
=
mem_alloc
(
OS_THREAD_MAX_N
*
sizeof
(
srv_slot_t
));
for
(
i
=
0
;
i
<
OS_THREAD_MAX_N
;
i
++
)
{
for
(
i
=
0
;
i
<
OS_THREAD_MAX_N
;
i
++
)
{
...
@@ -2146,6 +2151,8 @@ srv_sprintf_innodb_monitor(
...
@@ -2146,6 +2151,8 @@ srv_sprintf_innodb_monitor(
double
time_elapsed
;
double
time_elapsed
;
time_t
current_time
;
time_t
current_time
;
mutex_enter
(
&
srv_innodb_monitor_mutex
);
current_time
=
time
(
NULL
);
current_time
=
time
(
NULL
);
/* We add 0.001 seconds to time_elapsed to prevent division
/* We add 0.001 seconds to time_elapsed to prevent division
...
@@ -2256,6 +2263,7 @@ srv_sprintf_innodb_monitor(
...
@@ -2256,6 +2263,7 @@ srv_sprintf_innodb_monitor(
buf
+=
sprintf
(
buf
,
"----------------------------
\n
"
buf
+=
sprintf
(
buf
,
"----------------------------
\n
"
"END OF INNODB MONITOR OUTPUT
\n
"
"END OF INNODB MONITOR OUTPUT
\n
"
"============================
\n
"
);
"============================
\n
"
);
mutex_exit
(
&
srv_innodb_monitor_mutex
);
}
}
/*************************************************************************
/*************************************************************************
...
...
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