0
私のプロジェクトでFreeBSDのメソッド critical_enter()
とcritical_exit()
を呼び出そうとしています。UbuntuでのFreeBSD関数の使用
コンパイルする間、私はあなたがUbuntuの上でこれらの2に相当する可能性がある機能を知っていますエラー
implicit declaration of function ‘critical_exit’ [-Werror=implicit-function-declaration]
implicit declaration of function ‘critical_enter’ [-Werror=implicit-function-declaration]
を取得しますか?
これは存在しません。こちらをご覧ください[リンク](http://stackoverflow.com/questions/2595735/prevent-linux-thread-from-being-interrupted-by-scheduler)。なぜあなたはそれを使いたいのですか?それはCPUの移行を避けるためか、最も高いプロセス優先度を与えることですか? – Mquinteiro
Ringbufferの実装 – mgwork
おそらく私は間違っていますが、あなたは安全なスレッドメカニズムを探していて、critical_enter/exitを必要とせず、必要なものがmutexかセマフォであるように見えます。 [リンク] http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html#SYNCHRONIZATIONを見てください – Mquinteiro