use debug lock class

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3179 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-05-14 19:58:55 +00:00
parent ab1ba455f6
commit df8af83508
5 changed files with 10 additions and 13 deletions

View file

@ -17,13 +17,12 @@
"""
Cache for DNS lookups.
"""
import threading
import socket
import sys
import linkcheck.lock
from linkcheck.decorators import synchronized
_lock = threading.Lock()
_lock = linkcheck.lock.get_lock("addrinfo")
addrinfos = {}
@synchronized(_lock)

View file

@ -19,11 +19,10 @@ Store and retrieve open connections.
"""
import time
import threading
import linkcheck.lock
from linkcheck.decorators import synchronized
# lock for robots.txt caching
_lock = threading.Lock()
_lock = linkcheck.lock.get_lock("connection")
class ConnectionPool (object):

View file

@ -17,15 +17,14 @@
"""
Store and retrieve cookies.
"""
import threading
from linkcheck.decorators import synchronized
import linkcheck
import linkcheck.log
import linkcheck.lock
import linkcheck.cookies
# lock for caching
_lock = threading.Lock()
_lock = linkcheck.lock.get_lock("cookie")
class CookieJar (object):
"""

View file

@ -18,12 +18,12 @@
Store and retrieve country names for IPs.
"""
import os
import threading
import linkcheck.lock
from linkcheck.decorators import synchronized
# I don't know if the geoip library is already thread-safe, but
# we take no risks here.
_lock = threading.Lock()
_lock = linkcheck.lock.get_lock("geoip")
# initialize GeoIP database
geoip = None

View file

@ -17,14 +17,14 @@
"""
Cache robots.txt contents.
"""
import threading
from linkcheck.decorators import synchronized
import linkcheck.robotparser2
import linkcheck.configuration
import linkcheck.lock
# lock for caching
_lock = threading.Lock()
_lock = linkcheck.lock.get_lock("robots.txt")
class RobotsTxt (object):