- 论坛徽章:
- 0
|
回复 10# JohnBull
There are two threads
thread1 always call ioctl one time every second.
thread2 always call two steps ioctl one time every second.
thread2 require two step must not be interrupted by thread1's ioctl
The operations as the following is not permitted.
ioctl //thread2
ioctl //thread1 interrupted
ioctl //thread2
I want to use pthread_mutex, semaphore, cond_wait .... but because thread1 is a lib.and it can't not be changed.
So how can I protect two steps ioctl, guarantee it will not be interrupted by thread1?
Thanks very much.
和上面的情况类似。
只有运行在实时线程的上下文才不会被0优先级的普通任务打断。 所以另开一个SCHED_RR, priority=1的线程。 |
|