Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/threadable.pyc

ó
[³XMc@sñdZddlmZdefd„ƒYZd„Zee_d„Zd„Z	d„Z
d	d
„ZeƒZd„Z
d„Zd
„ZdaeayddlZddlZWnek
rÐdZdZnXeeƒddddgZdS(s
A module that will allow your program to be multi-threaded,
micro-threaded, and single-threaded.  Currently microthreads are
unimplemented.  The idea is to abstract away some commonly used
functionality so that I don't have to special-case it in all programs.
iÿÿÿÿ(thookt	DummyLockcBseZdZd„ZRS(sF
    Hack to allow locks to be unpickled on an unthreaded system.
    cCs
tdfS(N((t
unpickle_lock(tself((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyt
__reduce__s(t__name__t
__module__t__doc__R(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyRscCstdk	rtƒStƒSdS(N(tthreadingmoduletNonetXLockR(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyRscOsYd|jkrHtjƒd|jkr;tƒ|jd<ntjƒn|jjƒdS(Nt_threadable_lock(t__dict__t_synchLockCreatortacquireR
treleaseR(Rtatb((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyt	_synchPre s

cOs|jjƒdS(N(RR(RRR((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyt
_synchPost(scGs^tdk	rZxK|D]@}x7|jD],}tj||tƒtj||tƒq#WqWndS(s!Make all methods listed in each class' synchronized attribute synchronized.

    The synchronized attribute should be a list of strings, consisting of the
    names of methods that must be synchronized. If we are running in threaded
    mode these methods will be wrapped with a lock.
    N(tthreadmoduleR	tsynchronizedRtaddPreRtaddPostR(tklassestklasst
methodName((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pytsynchronize+s

icCsq|rXtsmtdk	rFtadtjtfd„ƒYatƒaqUt	dƒ‚qmntrmt	dƒ‚ndS(sbInitialize threading.

    Don't bother calling this.  If it needs to happen, it will happen.
    R
cBseZd„ZRS(cSs
tdfS(N((R(R((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyREs(RRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyR
Dss:Cannot initialize threading, platform lacks thread supportsCannot uninitialize threadsN(
tthreadedRR	tTrueRt_RLocktobjectR
R
tRuntimeError(twith_threads((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pytinit8scCstdkrtStjƒS(N(RR	t_dummyIDt	get_ident(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pytgetThreadIDRscCs
ttƒkS(sHAre we in the thread responsable for I/O requests (the event loop)?
    (tioThreadR%(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pytisInIOThreadXscCs
tƒadS(s=Mark the current thread as responsable for I/O requests.
    N(R%R&(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pytregisterAsIOThread_sNR'R(R%R
(Rttwisted.pythonRRRRRt__safe_for_unpickling__RRRR"R#R%R'R(R	R&tFalseRtthreadRt	threadingRtImportErrort__all__(((s=/usr/lib/python2.7/dist-packages/twisted/python/threadable.pyt<module>s,