0

im trying to invoke method from FreeBSD critical_enter() and critical_exit() in my project.

While compiling i get an error

implicit declaration of function ‘critical_exit’ [-Werror=implicit-function-declaration]
implicit declaration of function ‘critical_enter’ [-Werror=implicit-function-declaration]

Do you know which functions may be equivalent to these two on Ubuntu?

mgwork
  • 9
  • 2
  • 4
  • 1
    It does not exists, take a look here [link](http://stackoverflow.com/questions/2595735/prevent-linux-thread-from-being-interrupted-by-scheduler). Why do you want to use it? it is for avoid CPU migration or it is to give the highest process priority? – Mquinteiro Apr 28 '16 at 12:52
  • 1
    Ringbuffer implementation – mgwork Apr 28 '16 at 13:02
  • 1
    Perhaps I'm wrong but looks like you are looking for safe thread mechanism and you don't need critical_enter/exit what you need is mutex or semaphores. take a look to [link]http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html#SYNCHRONIZATION – Mquinteiro Apr 29 '16 at 07:52

1 Answers1

1

These functions are part of the FreeBSD kernel. They are not meant for user-mode programs, nor are they portable outside of the FreeBSD kernel.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94