On 30/05/13 16:15, Edward Ned Harvey (openindiana) wrote:
<snip>
I see there are a bunch of C constructs available ... mutex_init,
etc.  Surely there must be a wrapper application around this kind of
thing, right?

I spent some time looking for a lock in shell some time ago. The overall conclusion was that the only atomic operation in pure shell is mkdir.

I use /tmp or /var/run so it's at least deleted on reboot, and my scripts trap signals so when it ends (either correctly or after being interrupted), they do their best to remove it (that works well). If they do find a lock they don't expect, they scream, since a manual intervention is needed.

So far, it works correctly.

Laurent

_______________________________________________
OpenIndiana-discuss mailing list
OpenIndiana-discuss@openindiana.org
http://openindiana.org/mailman/listinfo/openindiana-discuss

Reply via email to