def __init__(self, value=1, name=None, oflags=0x0200):
        """Create a semaphore with initial value, possible name and flags."""
        if name:
            self.sem = None
            self.sem_p = self._sem_open("/%s" % name, oflags)
            if not self.sem_p:
                raise SemError()
        else:
            self.sem = c_sem()
            self.sem_p = c_sem_p(self.sem)
            if self._sem_init(self.sem_p, 0, value):
                raise SemError()
Create a semaphore with initial value, possible name and flags.
recipes/Python/577655_POSIX_Semaphore_FreeBSD/recipe-577655.py