Fix pool behavior with image save/restart

db4
Slava Pestov 2008-06-12 18:54:38 -05:00
parent a89c9758df
commit 9aadcace24
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@ TUPLE: pool connections disposed expired ;
dup check-disposed dup check-disposed
dup expired>> expired? [ dup expired>> expired? [
ALIEN: 31337 >>expired ALIEN: 31337 >>expired
connections>> [ delete-all ] [ dispose-each ] bi connections>> delete-all
] [ drop ] if ; ] [ drop ] if ;
: <pool> ( class -- pool ) : <pool> ( class -- pool )
@ -34,6 +34,7 @@ GENERIC: make-connection ( pool -- conn )
dup check-pool [ make-connection ] keep return-connection ; dup check-pool [ make-connection ] keep return-connection ;
: acquire-connection ( pool -- conn ) : acquire-connection ( pool -- conn )
dup check-pool
[ dup connections>> empty? ] [ dup new-connection ] [ ] while [ dup connections>> empty? ] [ dup new-connection ] [ ] while
connections>> pop ; connections>> pop ;