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
ef72d495
Commit
ef72d495
authored
Jan 26, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not "trust number of broadcasts" in shared IO_CACHE
parent
4aae71ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
mysys/mf_iocache.c
mysys/mf_iocache.c
+5
-5
No files found.
mysys/mf_iocache.c
View file @
ef72d495
...
@@ -442,10 +442,9 @@ void init_io_cache_share(IO_CACHE *info, IO_CACHE_SHARE *s, uint num_threads)
...
@@ -442,10 +442,9 @@ void init_io_cache_share(IO_CACHE *info, IO_CACHE_SHARE *s, uint num_threads)
pthread_mutex_init
(
&
s
->
mutex
,
MY_MUTEX_INIT_FAST
);
pthread_mutex_init
(
&
s
->
mutex
,
MY_MUTEX_INIT_FAST
);
pthread_cond_init
(
&
s
->
cond
,
0
);
pthread_cond_init
(
&
s
->
cond
,
0
);
s
->
total
=
s
->
count
=
num_threads
-
1
;
s
->
total
=
s
->
count
=
num_threads
-
1
;
s
->
active
=
0
;
/* to catch errors */
s
->
active
=
0
;
info
->
share
=
s
;
info
->
share
=
s
;
info
->
read_function
=
_my_b_read_r
;
info
->
read_function
=
_my_b_read_r
;
/* Ensure that the code doesn't use pointer to the IO_CACHE object */
info
->
current_pos
=
info
->
current_end
=
0
;
info
->
current_pos
=
info
->
current_end
=
0
;
}
}
...
@@ -465,7 +464,7 @@ void remove_io_thread(IO_CACHE *info)
...
@@ -465,7 +464,7 @@ void remove_io_thread(IO_CACHE *info)
pthread_mutex_unlock
(
&
s
->
mutex
);
pthread_mutex_unlock
(
&
s
->
mutex
);
}
}
static
int
lock_io_cache
(
IO_CACHE
*
info
)
static
int
lock_io_cache
(
IO_CACHE
*
info
,
my_off_t
pos
)
{
{
int
total
;
int
total
;
IO_CACHE_SHARE
*
s
=
info
->
share
;
IO_CACHE_SHARE
*
s
=
info
->
share
;
...
@@ -479,6 +478,7 @@ static int lock_io_cache(IO_CACHE *info)
...
@@ -479,6 +478,7 @@ static int lock_io_cache(IO_CACHE *info)
total
=
s
->
total
;
total
=
s
->
total
;
s
->
count
--
;
s
->
count
--
;
while
(
!
s
->
active
||
s
->
active
->
pos_in_file
<
pos
)
pthread_cond_wait
(
&
s
->
cond
,
&
s
->
mutex
);
pthread_cond_wait
(
&
s
->
cond
,
&
s
->
mutex
);
if
(
s
->
total
<
total
)
if
(
s
->
total
<
total
)
...
@@ -536,7 +536,7 @@ int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count)
...
@@ -536,7 +536,7 @@ int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count)
info
->
error
=
(
int
)
read_len
;
info
->
error
=
(
int
)
read_len
;
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
lock_io_cache
(
info
))
if
(
lock_io_cache
(
info
,
pos_in_file
))
{
{
info
->
share
->
active
=
info
;
info
->
share
->
active
=
info
;
if
(
info
->
seek_not_done
)
/* File touched, do seek */
if
(
info
->
seek_not_done
)
/* File touched, do seek */
...
...
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