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
53270955
Commit
53270955
authored
Jun 13, 2011
by
Michael Widenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change in PBXT to only use pth_set_priority() (not setpriority()) to set priority
parent
bf0e1f44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
30 deletions
+9
-30
storage/pbxt/src/pthread_xt.cc
storage/pbxt/src/pthread_xt.cc
+9
-30
No files found.
storage/pbxt/src/pthread_xt.cc
View file @
53270955
...
...
@@ -547,44 +547,23 @@ xtPublic void xt_p_init_threading(void)
xtPublic
int
xt_p_set_low_priority
(
pthread_t
thr
)
{
if
(
pth_min_priority
==
pth_max_priority
)
{
/* Under Linux the priority of normal (non-runtime)
* threads are set using the standard methods
* for setting process priority.
*/
/* We could set who == 0 because it should have the same affect
* as using the PID.
*/
/* -20 = highest, 20 = lowest */
#ifdef SET_GLOBAL_PRIORITY
if
(
setpriority
(
PRIO_PROCESS
,
getpid
(),
20
)
==
-
1
)
return
errno
;
#endif
return
0
;
}
if
(
pth_min_priority
!=
pth_max_priority
)
return
pth_set_priority
(
thr
,
pth_min_priority
);
return
0
;
}
xtPublic
int
xt_p_set_normal_priority
(
pthread_t
thr
)
{
if
(
pth_min_priority
==
pth_max_priority
)
{
if
(
setpriority
(
PRIO_PROCESS
,
getpid
(),
0
)
==
-
1
)
return
errno
;
return
0
;
}
if
(
pth_min_priority
!=
pth_max_priority
)
return
pth_set_priority
(
thr
,
pth_normal_priority
);
return
0
;
}
xtPublic
int
xt_p_set_high_priority
(
pthread_t
thr
)
{
if
(
pth_min_priority
==
pth_max_priority
)
{
if
(
setpriority
(
PRIO_PROCESS
,
getpid
(),
-
20
)
==
-
1
)
return
errno
;
return
0
;
}
if
(
pth_min_priority
!=
pth_max_priority
)
return
pth_set_priority
(
thr
,
pth_max_priority
);
return
0
;
}
#ifdef DEBUG_LOCKING
...
...
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