vcos is an operating system abstraction. (VideoCore Operating System) See https://github.com/raspberrypi/userland ... rface/vcos
for the full source of vcos.
In the case of vcos_semaphore_create on pthreads, see https://github.com/raspberrypi/userland ... orm.h#L324
It allows the resulting code to be run on a variety of operating systems, including pthreads, ThreadX, Symbian, Windows, and Nucleus. Back in Broadcom there were a number of test apps that would run on a number of those operating systems without modification, which makes cross platform regression testing significantly easier.
MMAL code in particular shares a significant proportion of the core code between the host OS (typically pthreads for the Pi) and ThreadX for the VPU, hence the need for an OS independent abstraction.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.