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
0ebe6007
Commit
0ebe6007
authored
Jan 16, 2010
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#50362:
Init MY_PTHREAD_MUTEX_FAST prior to first usage to avoid crash on FreeBSD
parent
8d665d79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
mysys/my_thr_init.c
mysys/my_thr_init.c
+15
-14
No files found.
mysys/my_thr_init.c
View file @
0ebe6007
...
...
@@ -88,6 +88,21 @@ my_bool my_thread_basic_global_init(void)
return
0
;
my_thread_basic_global_init_done
=
1
;
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
/*
Set mutex type to "fast" a.k.a "adaptive"
In this case the thread may steal the mutex from some other thread
that is waiting for the same mutex. This will save us some
context switches but may cause a thread to 'starve forever' while
waiting for the mutex (not likely if the code within the mutex is
short).
*/
pthread_mutexattr_init
(
&
my_fast_mutexattr
);
pthread_mutexattr_settype
(
&
my_fast_mutexattr
,
PTHREAD_MUTEX_ADAPTIVE_NP
);
#endif
mysql_mutex_init
(
key_THR_LOCK_malloc
,
&
THR_LOCK_malloc
,
MY_MUTEX_INIT_FAST
);
mysql_mutex_init
(
key_THR_LOCK_open
,
&
THR_LOCK_open
,
MY_MUTEX_INIT_FAST
);
mysql_mutex_init
(
key_THR_LOCK_charset
,
&
THR_LOCK_charset
,
MY_MUTEX_INIT_FAST
);
...
...
@@ -190,20 +205,6 @@ my_bool my_thread_global_init(void)
}
#endif
/* TARGET_OS_LINUX */
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
/*
Set mutex type to "fast" a.k.a "adaptive"
In this case the thread may steal the mutex from some other thread
that is waiting for the same mutex. This will save us some
context switches but may cause a thread to 'starve forever' while
waiting for the mutex (not likely if the code within the mutex is
short).
*/
pthread_mutexattr_init
(
&
my_fast_mutexattr
);
pthread_mutexattr_settype
(
&
my_fast_mutexattr
,
PTHREAD_MUTEX_ADAPTIVE_NP
);
#endif
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
/*
Set mutex type to "errorcheck"
...
...
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