0

vxWorks 関数 taskLock() および taskUnlock() を再実装したいと考えています。

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 が呼び出されるまで次のコードは中断されません。

Webで解決策が見つかりませんでした。

4

1 に答える 1

2

sourceforge.net/ taskLock コメントのv2lin プロジェクトから:

 taskLock - 'locks the scheduler' to prevent preemption of the current task
           by other task-level code.  Because we cannot actually lock the
           scheduler in a pthreads environment, we temporarily set the
           dynamic priority of the calling thread above that of any other
           thread, thus guaranteeing that no other tasks preempt it.

pthreads 環境ではスケジューラを実際にロックできないため

于 2012-09-26T13:47:28.887 に答える