Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
2f4b69c9
Commit
2f4b69c9
authored
8 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
SolverPoolFactory
parent
220398f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/inox/solvers/combinators/SolverPoolFactory.scala
+6
-4
6 additions, 4 deletions
...in/scala/inox/solvers/combinators/SolverPoolFactory.scala
with
6 additions
and
4 deletions
src/main/scala/inox/solvers/combinators/SolverPoolFactory.scala
+
6
−
4
View file @
2f4b69c9
/* Copyright 2009-2016 EPFL, Lausanne */
/* Copyright 2009-2016 EPFL, Lausanne */
package
leon
package
inox
package
solvers
package
solvers
package
combinators
package
combinators
...
@@ -17,7 +17,9 @@ import scala.reflect.runtime.universe._
...
@@ -17,7 +17,9 @@ import scala.reflect.runtime.universe._
* growing/shrinking pool size...
* growing/shrinking pool size...
*/
*/
class
SolverPoolFactory
[
+S
<:
Solver
](
ctx
:
LeonContext
,
sf
:
SolverFactory
[
S
])
extends
SolverFactory
[
S
]
{
trait
SolverPoolFactory
extends
SolverFactory
{
self
=>
val
sf
:
SolverFactory
{
val
program:
self.program.
type
;
type
S
=
self
.
S
}
val
name
=
"Pool("
+
sf
.
name
+
")"
val
name
=
"Pool("
+
sf
.
name
+
")"
...
@@ -25,7 +27,7 @@ class SolverPoolFactory[+S <: Solver](ctx: LeonContext, sf: SolverFactory[S]) ex
...
@@ -25,7 +27,7 @@ class SolverPoolFactory[+S <: Solver](ctx: LeonContext, sf: SolverFactory[S]) ex
val
poolMaxSize
=
5
val
poolMaxSize
=
5
private
[
this
]
val
availables
=
Queue
[
S
]()
private
[
this
]
val
availables
=
Queue
[
S
]()
private
[
this
]
var
inUse
=
Set
[
S
olver
]()
private
[
this
]
var
inUse
=
Set
[
S
]()
def
getNewSolver
()
:
S
=
{
def
getNewSolver
()
:
S
=
{
if
(
availables
.
isEmpty
)
{
if
(
availables
.
isEmpty
)
{
...
@@ -38,7 +40,7 @@ class SolverPoolFactory[+S <: Solver](ctx: LeonContext, sf: SolverFactory[S]) ex
...
@@ -38,7 +40,7 @@ class SolverPoolFactory[+S <: Solver](ctx: LeonContext, sf: SolverFactory[S]) ex
s
s
}
}
override
def
reclaim
(
s
:
S
olver
)
=
{
override
def
reclaim
(
s
:
S
)
=
{
try
{
try
{
s
.
reset
()
s
.
reset
()
inUse
-=
s
inUse
-=
s
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment