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
6eb200a4
Commit
6eb200a4
authored
Aug 23, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enclose rw_lock_validate() in #ifdef UNIV_DEBUG. It is only called by
debug assertions.
parent
20d53145
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
include/sync0rw.h
include/sync0rw.h
+2
-0
sync/sync0rw.c
sync/sync0rw.c
+3
-3
No files found.
include/sync0rw.h
View file @
6eb200a4
...
@@ -101,6 +101,7 @@ void
...
@@ -101,6 +101,7 @@ void
rw_lock_free
(
rw_lock_free
(
/*=========*/
/*=========*/
rw_lock_t
*
lock
);
/* in: rw-lock */
rw_lock_t
*
lock
);
/* in: rw-lock */
#ifdef UNIV_DEBUG
/**********************************************************************
/**********************************************************************
Checks that the rw-lock has been initialized and that there are no
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
simultaneous shared and exclusive locks. */
...
@@ -109,6 +110,7 @@ ibool
...
@@ -109,6 +110,7 @@ ibool
rw_lock_validate
(
rw_lock_validate
(
/*=============*/
/*=============*/
rw_lock_t
*
lock
);
rw_lock_t
*
lock
);
#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
corresponding function. */
corresponding function. */
...
...
sync/sync0rw.c
View file @
6eb200a4
...
@@ -174,9 +174,7 @@ rw_lock_free(
...
@@ -174,9 +174,7 @@ rw_lock_free(
/*=========*/
/*=========*/
rw_lock_t
*
lock
)
/* in: rw-lock */
rw_lock_t
*
lock
)
/* in: rw-lock */
{
{
#ifdef UNIV_DEBUG
ut_ad
(
rw_lock_validate
(
lock
));
ut_a
(
rw_lock_validate
(
lock
));
#endif
/* UNIV_DEBUG */
ut_a
(
rw_lock_get_writer
(
lock
)
==
RW_LOCK_NOT_LOCKED
);
ut_a
(
rw_lock_get_writer
(
lock
)
==
RW_LOCK_NOT_LOCKED
);
ut_a
(
rw_lock_get_waiters
(
lock
)
==
0
);
ut_a
(
rw_lock_get_waiters
(
lock
)
==
0
);
ut_a
(
rw_lock_get_reader_count
(
lock
)
==
0
);
ut_a
(
rw_lock_get_reader_count
(
lock
)
==
0
);
...
@@ -199,6 +197,7 @@ rw_lock_free(
...
@@ -199,6 +197,7 @@ rw_lock_free(
mutex_exit
(
&
rw_lock_list_mutex
);
mutex_exit
(
&
rw_lock_list_mutex
);
}
}
#ifdef UNIV_DEBUG
/**********************************************************************
/**********************************************************************
Checks that the rw-lock has been initialized and that there are no
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
simultaneous shared and exclusive locks. */
...
@@ -226,6 +225,7 @@ rw_lock_validate(
...
@@ -226,6 +225,7 @@ rw_lock_validate(
return
(
TRUE
);
return
(
TRUE
);
}
}
#endif
/* UNIV_DEBUG */
/**********************************************************************
/**********************************************************************
Lock an rw-lock in shared mode for the current thread. If the rw-lock is
Lock an rw-lock in shared mode for the current thread. If the rw-lock is
...
...
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