%PDF- %PDF-
Direktori : /usr/local/lib/python2.7/test/ |
Current File : //usr/local/lib/python2.7/test/fork_wait.pyo |
ó Nêáac @ sƒ d Z d d l Z d d l Z d d l Z d d l Z d d l j Z e j d ƒ Z d Z d Z d Z d e j f d „ ƒ YZ d S( sû This test case provides support for checking forking and wait behavior. To test different wait behavior, override the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active threads survive in the child after a fork(); this is an error. While BeOS doesn't officially support fork and native threading in the same application, the present example should work just fine. DC iÿÿÿÿNt threadingi g à?i t ForkWaitc B s5 e Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( c C s. t j ƒ | _ i | _ d | _ g | _ d S( Ni ( t supportt threading_setupt _threading_keyt alivet stopt threads( t self( ( s* /usr/local/lib/python2.7/test/fork_wait.pyt setUp s c C sH d | _ x | j D] } | j ƒ q Wd } | j 2t j | j Œ d S( Ni ( R R t joint NoneR t threading_cleanupR ( R t thread( ( s* /usr/local/lib/python2.7/test/fork_wait.pyt tearDown s c C sL xE | j sG t j ƒ | j | <y t j t ƒ Wq t k rC q Xq Wd S( N( R t ost getpidR t timet sleept SHORTSLEEPt IOError( R t id( ( s* /usr/local/lib/python2.7/test/fork_wait.pyt f) s c C sŒ xP t d ƒ D]B } t j | t j ƒ \ } } | | k r>