mň x%ÜGc@sedkZdZdfd„ƒYZy dkZWnej o eZn XeiZyšeidjoUdkZdk Z dk Z ei Z dZ eiZe iƒZd„Zd„ZnQeidjo:dkZei Z ei Z eiZd „Zd „Znd ‚Wn+dZ dZ dZd „Zd „ZnXdfd„ƒYZdfd„ƒYZdS(NsSpyce locking-related functionst dummyLockcBstZed„Zd„ZRS(NcCstS(N(tTrue(tselftblock((t-/home/holguin2/public_html/spyce/spyceLock.pytacquire scCsdS(N((R((Rtreleases(t__name__t __module__RRR(((RR s tnticCs3ti|iƒƒ}ti||dd tƒdS(Nii(t win32filet_get_osfhandletfiletfilenothfilet LockFileExtflagst __overlapped(R RR((Rt file_lock0scCs0ti|iƒƒ}ti|dd tƒdS(Nii(R R R R Rt UnlockFileExR(R R((Rt file_unlock3stposixcCsti|iƒ|ƒdS(N(tfcntltflockR R R(R R((RR;scCsti|iƒtiƒdS(N(RRR R tLOCK_UN(R ((RR=ss&locking not supported on this platformcCsdS(N((R R((RRFscCsdS(N((R ((RRGstfileLockcBs0tZdZZd„Zdd„Zd„ZRS(NcCs|d|_dS(Ns.lock(tnameR(RR((Rt__init__KsicCsHt|idƒ|_|ot|itƒnt|ittBƒdS(Ntw(topenRRtfRRtLOCK_EXtLOCK_NB(RR((RRMscCsWyI|ipdSnt|iƒ|iiƒti|iƒd|_WnnXdS(N(RRRtclosetostunlinkRtNone(R((RRQs    (RRR$RRRRR(((RRIs   t MultiLockcBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(s‹ A lock that reduces contention by maintaining multiple locks internally and mapping requests in a consistent manner to these. cCs:g|_x*t|ƒD]}|ii||ƒƒqWdS(N(Rtlockstxrangetitappendtlock_generator(RR&R*R(((RR`s  cCs|it|ƒt|iƒS(N(RR&thashtobjtlen(RR,((Rt_lockdscOs|i|ƒ}|i||ŽS(N(RR.R,tlockRtargstkwargs(RR,R0R1R/((RRfscOs|i|ƒ}|i||ŽS(N(RR.R,R/RR0R1(RR,R0R1R/((RRiscOs|i|ƒ}|i||ŽS(N(RR.R,R/tlockedR0R1(RR,R0R1R/((RR2ls(RRt__doc__RR.RRR2(((RR%[s     (R"R3Rt threadingt ImportErrort threadLocktRLockRtwin32conR t pywintypestLOCKFILE_EXCLUSIVE_LOCKRtLOCK_SHtLOCKFILE_FAIL_IMMEDIATELYR t OVERLAPPEDRRRRRR%(RRRR6RRR R R%R4RR8RR9R"R3R;((Rt?s@