ALT Linux Bugzilla
– Attachment 1697 Details for
Bug 10364
Блокирование таймера созданного timer_create()
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
Программка тестирования на блокировку прерываний
timer_test.cpp (text/plain), 1.51 KB, created by
Roman Savochenko
on 2006-12-05 11:41:13 MSK
(
hide
)
Description:
Программка тестирования на блокировку прерываний
Filename:
MIME Type:
Creator:
Roman Savochenko
Created:
2006-12-05 11:41:13 MSK
Size:
1.51 KB
patch
obsolete
>#include <stdio.h> >#include <unistd.h> >#include <signal.h> >#include <time.h> > >void FastTask(union sigval obj) >{ > printf("Fast task call.\n"); >} > >void SlowTask(union sigval obj) >{ > printf("Begin the slow and the long execution task call.\n"); > sleep(1); > printf("End the slow and the long execution task call.\n"); >} > >int main( int argc, char **argv ) >{ > //Create and start the fast timer > //- Create fast timer - > timer_t tmIdFast; > struct sigevent sigev; > sigev.sigev_notify = SIGEV_THREAD; > sigev.sigev_value.sival_ptr = NULL; > sigev.sigev_notify_function = FastTask; > sigev.sigev_notify_attributes = NULL; > timer_create(CLOCK_REALTIME,&sigev,&tmIdFast); > > //- Start the fast timer - > struct itimerspec itval; > itval.it_interval.tv_sec = itval.it_value.tv_sec = 0; > itval.it_interval.tv_nsec = itval.it_value.tv_nsec = 200000000; > timer_settime(tmIdFast, 0, &itval, NULL); > > > //Create and start the slow and the long execution timer > //- Create the slow and the long execution timer - > timer_t tmIdSlow; > sigev.sigev_notify = SIGEV_THREAD; > sigev.sigev_value.sival_ptr = NULL; > sigev.sigev_notify_function = SlowTask; > sigev.sigev_notify_attributes = NULL; > timer_create(CLOCK_REALTIME,&sigev,&tmIdSlow); > > //- Start the slow and the long execution timer - > itval.it_interval.tv_sec = itval.it_value.tv_sec = 2; > itval.it_interval.tv_nsec = itval.it_value.tv_nsec = 0; > timer_settime(tmIdSlow, 0, &itval, NULL); > > sleep(10); > > return 0; >}
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 10364
: 1697