I have never considered all these library calls, but as far as I understand, they are all related to kernel operations, since they should provide synchronization between the process and / or threads at the global level - I mean at the OS level.
The kernel needs to be supported for mutex , for example, a list of threads: threads that are currently sleeping, waiting for the locked mutex to be released . When a thread that is currently blocking / owning this mutex calls the kernel using pthread_mutex_release() , the kernel system call will look at this aforementioned list to get a thread with a higher priority waiting for mutex to be released, a flag for the new mutex owner in the kernel mutex structure, and then transfer the processor (aka "ontect switch") to the new owner's thread, so this process will return from the posix library call pthread_mutex_lock() .
I only see cooperation with the kernel when it is connected with IPC between processes (I do not speak between threads at the same process level). Therefore, I expect the library call to call the kernel, so.
source share