eina lock semaphores - do not use shared semaphores and fix osx names
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 5 Aug 2016 09:11:42 +0000 (18:11 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 5 Aug 2016 09:11:42 +0000 (18:11 +0900)
commit4a40ff95defa5fa7e6164459c50e674b53cddaf4
treecaa49c6d4cb74c622af79b16b183fc748bd72d79
parent8fd224b4d665ff420c9d803eec9d9e5b449ed503
eina lock semaphores - do not use shared semaphores and fix osx names

the way eina does sempahores, they can NEVER be sensibly shared
cross-process portably. so enabling sharing is a pointless idea. in
fact some os's like openbsd check if the sempahore addres is in a
sharable mem region and deny init if it is not. on osx you dont use
shared memory but a sempahore name you share instead... and this is
not exposed thus it can't be shared either. if we did process sharable
semaphores we'd make shm segments and/or name them in a sharable way
were you can share the idenitifer of the shm segment and/or the offset
address or name from osx. but we don't, so making them
process-private is the right thing. sharable sempahores will need a
whole new api.

this also fixes osx naming to make the name pretty unguessable/private
and opened exclusive (or it fails) by using pid, sem counter, and 4
random numbers. it's not a security mechanism as the create will fail
if there is a clash. chances are low. we unlink before anyway. good
enough for osx for now.

@fix
src/lib/eina/eina_inline_lock_posix.x