0
我想重新实现vxWorks函数taskLock()和taskUnlock()。pthread锁定/解锁解决方案
这是vxWorks函数的原始描述。
* taskUnlock - enable task rescheduling
*
* This routine decrements the preemption lock count. Typically this call is
* paired with taskLock() and concludes a critical section of code.
* Preemption will not be unlocked until taskUnlock() has been called as many
* times as taskLock(). When the lock count is decremented to zero, any tasks
* that were eligible to preempt the current task will execute.
*
* The taskUnlock() routine is not callable from interrupt service routines.
我使用pthreads来重新实现vxWorks任务。那么有没有可能做到这一点?
如果我理解正确。如果函数调用taskLock,则在调用taskunlock之前不会中断以下代码。
我在网上找不到解决方案。
你为什么这样做它的调度?你最终的目标是什么? –
@MaximYegorushkin'我想重新实现vxWorks函数taskLock()和taskUnlock()。 '因为有一个vxwork相关的驱动程序(但这不是这篇文章的上下文) – Manfred