3
0
Fork 0
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:
Christoph M. Wintersteiger 2015-10-14 13:58:51 +01:00
parent 2d2ec38541
commit 24532474a0
3 changed files with 44 additions and 26 deletions

View file

@ -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();
}
}
/**