#NEWLINE# def __setitem__( self , sessionID , session ) : #NEWLINE# #INDENT# self . lock . acquire ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . entriesDict [ sessionID ] = session #NEWLINE# self . entriesList [ sessionID . lastIndex ] = ( sessionID , time . time ( ) ) #NEWLINE# self . lastIndex = ( ( self . lastIndex + 1 ) % len ( self . entriesList ) ) #NEWLINE# if ( self . lastIndex == self . firstIndex ) : #NEWLINE# #INDENT# del self . entriesDict [ self . entriesList [ self . firstIndex ] [ 0 ] ] #NEWLINE# self . firstIndex = ( ( self . firstIndex + 1 ) % len ( self . entriesList ) ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# self . lock . release ( )