mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 13:40:52 +00:00
Bugfix for concurrent Context creation in Java and .NET.
Relates to #205 #245
This commit is contained in:
parent
2d2ec38541
commit
24532474a0
3 changed files with 44 additions and 26 deletions
|
@ -35,8 +35,11 @@ public class InterpolationContext extends Context
|
|||
**/
|
||||
public InterpolationContext()
|
||||
{
|
||||
m_ctx = Native.mkInterpolationContext(0);
|
||||
initContext();
|
||||
super();
|
||||
synchronized(creation_lock) {
|
||||
m_ctx = Native.mkInterpolationContext(0);
|
||||
initContext();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,12 +51,15 @@ public class InterpolationContext extends Context
|
|||
**/
|
||||
public InterpolationContext(Map<String, String> settings)
|
||||
{
|
||||
long cfg = Native.mkConfig();
|
||||
for (Map.Entry<String, String> kv : settings.entrySet())
|
||||
Native.setParamValue(cfg, kv.getKey(), kv.getValue());
|
||||
m_ctx = Native.mkInterpolationContext(cfg);
|
||||
Native.delConfig(cfg);
|
||||
initContext();
|
||||
super();
|
||||
synchronized(creation_lock) {
|
||||
long cfg = Native.mkConfig();
|
||||
for (Map.Entry<String, String> kv : settings.entrySet())
|
||||
Native.setParamValue(cfg, kv.getKey(), kv.getValue());
|
||||
m_ctx = Native.mkInterpolationContext(cfg);
|
||||
Native.delConfig(cfg);
|
||||
initContext();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue