- 论坛徽章:
- 0
|
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. |
|