diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-06-24 21:43:31 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-06-24 21:43:31 +0400 |
commit | 7880039fc0a2c406fe924e3dcbc09f0691e49007 (patch) | |
tree | 618d80f7f5a95cf7d1ee9b16bf9bfc1e6d8fbf74 /storage/pbxt | |
parent | d6b0767c8c819655e0a90b8f9c33356f92832c87 (diff) | |
parent | 3d4e3472886a7d3fd939c0cc0b49637fc8c48498 (diff) | |
download | mariadb-git-7880039fc0a2c406fe924e3dcbc09f0691e49007.tar.gz |
Merge 5.2 -> 5.3
(testcase for #798597 now crashes)
Diffstat (limited to 'storage/pbxt')
-rwxr-xr-x | storage/pbxt/src/pthread_xt.cc | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/storage/pbxt/src/pthread_xt.cc b/storage/pbxt/src/pthread_xt.cc index 9f35f50b8c7..d704e977c21 100755 --- a/storage/pbxt/src/pthread_xt.cc +++ b/storage/pbxt/src/pthread_xt.cc @@ -506,44 +506,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; - } - return pth_set_priority(thr, pth_min_priority); + 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; - } - return pth_set_priority(thr, pth_normal_priority); + 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; - } - return pth_set_priority(thr, pth_max_priority); + if (pth_min_priority != pth_max_priority) + return pth_set_priority(thr, pth_max_priority); + return 0; } #ifdef DEBUG_LOCKING |