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