FreeBSD Bugzilla – Attachment 98190 Details for
Bug 137056
multimedia/vlc: VLC 1.0.0 does not work on 7.1 + workaround patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
sched.cxx.txt
sched.cxx.txt (text/plain), 2.08 KB, created by
Václav Haisman
on 2009-07-24 18:27:26 UTC
(
hide
)
Description:
sched.cxx.txt
Filename:
MIME Type:
Creator:
Václav Haisman
Created:
2009-07-24 18:27:26 UTC
Size:
2.08 KB
patch
obsolete
>#include <pthread.h> >#include <cerrno> >#include <iostream> > >#define S2(X) #X > >#define S(X) S2(X) > > >#define CHECK2(X,E) do { \ > int ret; \ > ret = (X); \ > std::cout << #X ":" S(__LINE__) ": \t" << ret; \ > if (ret == (E)) \ > std::cout << ", errno: " << errno; \ > std::cout << std::endl; \ > } while (0) > > >#define CHECKM1(X) CHECK2(X, -1) > > >#define CHECKOK(X,E) do { \ > int ret; \ > ret = (X); \ > std::cout << #X ":" S(__LINE__) ": \t" << ret; \ > if (ret != (E)) \ > std::cout << ", errno: " << ret; \ > std::cout << std::endl; \ > } while (0) > > >#define CHECK(X) CHECKOK(X, 0) > > >#define PRINT(X) do { \ > std::cout << #X ": \t" << (X) << std::endl; \ >} while (0) > > >void * nothing (void *) >{ } > > >void >test_schedparam (int policy) >{ > int prio; > pthread_attr_t attr; > struct sched_param schp = {}; > pthread_t * thr; > > std::cout << "policy: " << policy << std::endl; > > CHECK (pthread_attr_init (&attr)); > CHECK (pthread_attr_setschedpolicy (&attr, policy)); > > CHECKM1 (prio = sched_get_priority_min (policy)); > schp.sched_priority = prio; > CHECK (pthread_attr_setschedparam (&attr, &schp)); > > thr = new pthread_t; > CHECKOK (pthread_create (thr, &attr, nothing, 0), 0); > > CHECKM1 (prio = sched_get_priority_max (policy)); > schp.sched_priority = prio; > CHECK (pthread_attr_setschedparam (&attr, &schp)); > > thr = new pthread_t; > CHECKOK (pthread_create (thr, &attr, nothing, 0), 0); > > pthread_attr_destroy (&attr); > > std::cout << "\n" << std::endl; >} > > >int >main () >{ > PRINT (SCHED_FIFO); > PRINT (SCHED_OTHER); > PRINT (SCHED_RR); > > test_schedparam (SCHED_FIFO); > test_schedparam (SCHED_OTHER); > test_schedparam (SCHED_RR); > > PRINT (EPERM); > PRINT (EINVAL); > PRINT (ENOSYS); > PRINT (ESRCH); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 137056
:
98189
| 98190