• Poul-Henning Kamp's avatar
    Fix an inconsequential oversight in session management, and prevent it from · 32038aec
    Poul-Henning Kamp authored
    happening again:
    
    We optimize session allocation, SES_New(), to minimize the amount
    of locking the VCA_thread participates in with flip-flop lists of
    free sessions: Allocate from one list, free to the other, flip lists
    only when necessary.
    
    This scheme only works if nobody but VCA_thread calls SES_New().
    
    Background worker threads need dummy sessions and thus called into
    SES_New() as well.
    
    These calls all happen during startup, so they do in fact not mess
    up the locking, but made mockery of a number of very stern comments.
    
    Add SES_Alloc() for such "other uses" and enforce VCA_thread monopoly
    with an assert.
    
    
    git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4069 d4fa192b-c00b-0410-8231-f00ffab90ce4
    32038aec
cache.h 18.3 KB