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
e3450ecf
Commit
e3450ecf
authored
Aug 28, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B28284-5.1-opt
parents
a002f3cd
63d18a60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
include/my_pthread.h
include/my_pthread.h
+1
-0
mysys/my_init.c
mysys/my_init.c
+3
-0
mysys/thr_mutex.c
mysys/thr_mutex.c
+11
-6
No files found.
include/my_pthread.h
View file @
e3450ecf
...
...
@@ -519,6 +519,7 @@ typedef struct st_my_pthread_fastmutex_t
pthread_mutex_t
mutex
;
uint
spins
;
}
my_pthread_fastmutex_t
;
void
fastmutex_global_init
(
void
);
int
my_pthread_fastmutex_init
(
my_pthread_fastmutex_t
*
mp
,
const
pthread_mutexattr_t
*
attr
);
...
...
mysys/my_init.c
View file @
e3450ecf
...
...
@@ -78,6 +78,9 @@ my_bool my_init(void)
my_umask_dir
=
0700
;
/* Default umask for new directories */
#if defined(THREAD) && defined(SAFE_MUTEX)
safe_mutex_global_init
();
/* Must be called early */
#endif
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
fastmutex_global_init
();
/* Must be called early */
#endif
netware_init
();
#ifdef THREAD
...
...
mysys/thr_mutex.c
View file @
e3450ecf
...
...
@@ -394,15 +394,11 @@ ulong mutex_delay(ulong delayloops)
#define MY_PTHREAD_FASTMUTEX_SPINS 8
#define MY_PTHREAD_FASTMUTEX_DELAY 4
static
int
cpu_count
=
0
;
int
my_pthread_fastmutex_init
(
my_pthread_fastmutex_t
*
mp
,
const
pthread_mutexattr_t
*
attr
)
{
static
int
cpu_count
=
0
;
#ifdef _SC_NPROCESSORS_CONF
if
(
!
cpu_count
&&
(
attr
==
MY_MUTEX_INIT_FAST
))
cpu_count
=
sysconf
(
_SC_NPROCESSORS_CONF
);
#endif
if
((
cpu_count
>
1
)
&&
(
attr
==
MY_MUTEX_INIT_FAST
))
mp
->
spins
=
MY_PTHREAD_FASTMUTEX_SPINS
;
else
...
...
@@ -432,4 +428,13 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp)
}
return
pthread_mutex_lock
(
&
mp
->
mutex
);
}
void
fastmutex_global_init
(
void
)
{
#ifdef _SC_NPROCESSORS_CONF
cpu_count
=
sysconf
(
_SC_NPROCESSORS_CONF
);
#endif
}
#endif
/* defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_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