Fix pool behavior with image save/restart
parent
a89c9758df
commit
9aadcace24
|
@ -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 ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue