Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
1d4d9e79
Commit
1d4d9e79
authored
Oct 25, 2012
by
Mukund Sivaraman
Browse files
[2236] Use PTHREAD_MUTEX_NORMAL fast mutexes by default
parent
7c4e02c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/util/threads/sync.cc
View file @
1d4d9e79
...
...
@@ -77,13 +77,18 @@ Mutex::Mutex() :
}
Deinitializer
deinitializer
(
attributes
);
// If debug mode is enabled in compilation, use the slower
// error-checking mutexes that detect deadlocks. Otherwise, use fast
// mutexes which don't. See the pthread_mutexattr_settype() POSIX
// documentation which describes these type attributes.
#ifdef ENABLE_DEBUG
// TODO: Distinguish if debug mode is enabled in compilation.
result
=
pthread_mutexattr_settype
(
&
attributes
,
PTHREAD_MUTEX_ERRORCHECK
);
#else
result
=
pthread_mutexattr_settype
(
&
attributes
,
PTHREAD_MUTEX_NORMAL
);
#endif // ENABLE_DEBUG
if
(
result
!=
0
)
{
isc_throw
(
isc
::
InvalidOperation
,
std
::
strerror
(
result
));
}
#endif // ENABLE_DEBUG
auto_ptr
<
Impl
>
impl
(
new
Impl
);
result
=
pthread_mutex_init
(
&
impl
->
mutex
,
&
attributes
);
...
...
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