mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Remove support for REALTIME_PRIORITY_CLASS in proc_nice() on Windows.
The reasoning for this is because that it requires special permissions and can in the end be dangerous, discovered by Anatol.
This commit is contained in:
parent
271ed78a31
commit
ddf95667c4
2 changed files with 4 additions and 8 deletions
|
@ -30,8 +30,6 @@
|
|||
* +-----------------------+-----------------------------+
|
||||
* | Expression | Priority type |
|
||||
* +-----------------------+-----------------------------+
|
||||
* | priority < -14 | REALTIME_PRIORITY_CLASS |
|
||||
* +-----------------------+-----------------------------+
|
||||
* | priority < -9 | HIGH_PRIORITY_CLASS |
|
||||
* +-----------------------+-----------------------------+
|
||||
* | priority < -4 | ABOVE_NORMAL_PRIORITY_CLASS |
|
||||
|
@ -48,15 +46,15 @@
|
|||
*
|
||||
* This is applied to the main process, not per thread, although this could
|
||||
* be implemented using SetThreadPriority() at one point.
|
||||
*
|
||||
* Note, it is intended that some priority classes are left out.
|
||||
*/
|
||||
|
||||
PHPAPI int nice(zend_long p)
|
||||
{
|
||||
DWORD dwFlag = NORMAL_PRIORITY_CLASS;
|
||||
|
||||
if (p < -14) {
|
||||
dwFlag = REALTIME_PRIORITY_CLASS;
|
||||
} else if (p < -9) {
|
||||
if (p < -9) {
|
||||
dwFlag = HIGH_PRIORITY_CLASS;
|
||||
} else if (p < -4) {
|
||||
dwFlag = ABOVE_NORMAL_PRIORITY_CLASS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue