[fpc-devel] Why FreeBSD sem_init() works different to Linux?

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed Feb 6 20:24:34 CET 2013


Hi,

OK, now that we established that semaphores are broken in FreeBSD using
FPC 2.6.0 and the upcoming FPC 2.6.2. I'm looking for an alternative.

An alternative for two reasons.
  - I hate IFDEF code, and the semaphore code between Linux, FreeBSD
    and Windows are different.
  - Semaphore sem_t structure is incorrectly defined for FreeBSD, so
    I'll have to implement a special case for that platform.

Semaphore functionality seems pretty simple though, so I am thinking of
creating my own Object Pascal based cross-platform semaphore - no low
level code or OS specific library API's.

It case I'm overlooking something critical, has anybody else done
something like this. If so, anybody willing to share that code - saving
me some time in developing, unit testing and debugging my own Object
Pascal based semaphore.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/




More information about the fpc-devel mailing list