Changeset aa47b1621816c96eff4d6c7edb7b4859192013a4
- Timestamp:
- 06/06/08 16:48:48
(4 months ago)
- Author:
- Rémi Denis-Courmont <rdenis@simphalempin.com>
- git-committer:
- Rémi Denis-Courmont <rdenis@simphalempin.com> 1212763728 +0300
- git-parent:
[33c8a14f95a2c378b1f374ff3e2d3e669d4992a3]
- git-author:
- Rémi Denis-Courmont <rdenis@simphalempin.com> 1212763728 +0300
- Message:
Rescale POSIX realtime priorities within a portable range
POSIX warrants at least 32 priorities from
sched_get_priority_min(SCHED_RR) to sched_get_priority_max(SCHED_RR).
We were previously relying on 41 priorities, from 0 to 40.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra93015e |
raa47b16 |
|
| 79 | 79 | |
|---|
| 80 | 80 | #elif defined(LIBVLC_USE_PTHREAD) |
|---|
| 81 | | # define VLC_THREAD_PRIORITY_LOW 0 |
|---|
| 82 | | # define VLC_THREAD_PRIORITY_INPUT 20 |
|---|
| 83 | | # define VLC_THREAD_PRIORITY_AUDIO 10 |
|---|
| 84 | | # define VLC_THREAD_PRIORITY_VIDEO 0 |
|---|
| 85 | | # define VLC_THREAD_PRIORITY_OUTPUT 30 |
|---|
| 86 | | # define VLC_THREAD_PRIORITY_HIGHEST 40 |
|---|
| | 81 | # define VLC_THREAD_PRIORITY_LOW 0 |
|---|
| | 82 | # define VLC_THREAD_PRIORITY_INPUT 10 |
|---|
| | 83 | # define VLC_THREAD_PRIORITY_AUDIO 5 |
|---|
| | 84 | # define VLC_THREAD_PRIORITY_VIDEO 0 |
|---|
| | 85 | # define VLC_THREAD_PRIORITY_OUTPUT 15 |
|---|
| | 86 | # define VLC_THREAD_PRIORITY_HIGHEST 20 |
|---|
| 87 | 87 | |
|---|
| 88 | 88 | #elif defined(WIN32) || defined(UNDER_CE) |
|---|
| r33c8a14 |
raa47b16 |
|
| 49 | 49 | |
|---|
| 50 | 50 | #if defined( LIBVLC_USE_PTHREAD ) |
|---|
| | 51 | # include <sched.h> |
|---|
| | 52 | |
|---|
| 51 | 53 | static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; |
|---|
| 52 | 54 | #endif |
|---|
| … | … | |
| 521 | 523 | else |
|---|
| 522 | 524 | { |
|---|
| 523 | | struct sched_param param = { .sched_priority = +i_priority, }; |
|---|
| 524 | | pthread_attr_setschedpolicy (&attr, SCHED_OTHER); |
|---|
| | 525 | struct sched_param param = { .sched_priority = i_priority, }; |
|---|
| | 526 | |
|---|
| | 527 | param.sched_priority += sched_get_priority_min (SCHED_RR); |
|---|
| | 528 | pthread_attr_setschedpolicy (&attr, SCHED_RR); |
|---|
| 525 | 529 | pthread_attr_setschedparam (&attr, ¶m); |
|---|
| 526 | 530 | } |
|---|