• Barry Warsaw's avatar
    Simplify again the WorkThread api. Don't use a non-portable poll · f595bdbf
    Barry Warsaw authored
    object -- because we just care about one event we can simply use a
    threading.Event object.  Specific changes include,
    
    BerkeleyBase.py
    
        __init__(): Simplify the creation of the checkpointer and
        autopacker worker threads.
    
        close(): Replace autopacker.stop() with setting the Event object.
        This both kicks us out of the wait() and sets the thread's
        internal stop flag, so it's all we need.
    
        _WorkThread.init(): Take the `name' argument out of the
        constructor.  It was the only thing that 2/3rds of the subclasses
        needed to override, so just stick it in a class attribute.
    
        run(): Simplify to use the Event object.  Also, change _nextcheck
        to recalculate `now' after the work is done.  There's no telling
        how much time the work will take (it may not matter much in
        practice).
    
        stop(): Removed.
    
        _Checkpoint.__init__(): Removed
    
    Full.py
    
        _make_autopacker(): Updated
    
        _Autopack.__init__(): Updated
    
    Minimal.py
    
        _make_autopacker(): Updated
    
        _Autopack.__init__(): Removed
    f595bdbf
BerkeleyBase.py 18.2 KB