#!/usr/bin/env python

import os, shmobj

x = shmobj.SHMINT(44)
y = shmobj.SHMINT(55)
l = shmobj.SHMLST([x])
sem = shmobj.semaphore()

sem.wait()
rc = os.fork()
if rc == 0:  # child
    sem.wait()
    print os.getpid(), l
else:
    l.append(y)
    print os.getpid(), l
    sem.post()
    (pid,stat) = os.waitpid(rc,0)

a60f3dcc525e29a49de3bff8777c55c3b1cf8749
#!/usr/bin/env python

import os, shmobj

x = shmobj.SHMINT(44)
y = shmobj.SHMINT(55)
l = shmobj.SHMLST([x])
sem = shmobj.semaphore()

sem.wait()
rc = os.fork()
if rc == 0:  # child
    sem.wait()
    print os.getpid(), l
else:
    l.append(y)
    print os.getpid(), l
    sem.post()
    (pid,stat) = os.waitpid(rc,0)
