Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefineDynamicModule with emitSymbolInfo raise ExecutionEngineException on Unity player for Win/Mac #1

Open
wants to merge 7 commits into
base: unity
Choose a base branch
from
34 changes: 17 additions & 17 deletions Clojure/Clojure/Lib/MultiFn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public IPersistentMap PreferTable
/// </summary>
volatile object _cachedHierarchy;

ReaderWriterLockSlim _rw;
// ReaderWriterLockSlim _rw;
bool _disposed = false;

//static readonly Var _assoc = RT.var("clojure.core", "assoc");
Expand Down Expand Up @@ -112,7 +112,7 @@ public MultiFn(string name, IFn dispatchFn, object defaultDispatchVal, IRef hier
_preferTable = PersistentHashMap.EMPTY;
_hierarchy = hierarchy;
_cachedHierarchy = null;
_rw = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
// _rw = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
}

#endregion
Expand All @@ -128,7 +128,7 @@ public MultiFn(string name, IFn dispatchFn, object defaultDispatchVal, IRef hier
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "add")]
public MultiFn addMethod(object dispatchVal, IFn method)
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
_methodTable = MethodTable.assoc(dispatchVal, method);
Expand All @@ -137,7 +137,7 @@ public MultiFn addMethod(object dispatchVal, IFn method)
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand All @@ -150,7 +150,7 @@ public MultiFn addMethod(object dispatchVal, IFn method)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "remove")]
public MultiFn removeMethod(object dispatchVal)
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
_methodTable = MethodTable.without(dispatchVal);
Expand All @@ -159,7 +159,7 @@ public MultiFn removeMethod(object dispatchVal)
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand All @@ -172,7 +172,7 @@ public MultiFn removeMethod(object dispatchVal)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "prefer")]
public MultiFn preferMethod(object dispatchValX, object dispatchValY)
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
if (Prefers(dispatchValY, dispatchValX))
Expand All @@ -185,7 +185,7 @@ public MultiFn preferMethod(object dispatchValX, object dispatchValY)
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand Down Expand Up @@ -242,7 +242,7 @@ private bool Dominates(object x, object y)
/// <returns></returns>
private IPersistentMap ResetCache()
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
_methodCache = MethodTable;
Expand All @@ -251,7 +251,7 @@ private IPersistentMap ResetCache()
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand Down Expand Up @@ -294,7 +294,7 @@ private IFn GetFn(object dispatchVal)
/// <returns>The mest method.</returns>
private IFn FindAndCacheBestMethod(object dispatchVal)
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
IMapEntry bestEntry;
IPersistentMap mt = _methodTable;
IPersistentMap pt = _preferTable;
Expand All @@ -319,11 +319,11 @@ private IFn FindAndCacheBestMethod(object dispatchVal)
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}

// ensure basis has stayed stable throughout, else redo
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
if (mt == _methodTable
Expand All @@ -343,7 +343,7 @@ private IFn FindAndCacheBestMethod(object dispatchVal)
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand Down Expand Up @@ -375,7 +375,7 @@ public IPersistentMap getPreferTable()
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "reset")]
public MultiFn reset()
{
_rw.EnterWriteLock();
// _rw.EnterWriteLock();
try
{
_methodTable = _methodCache = _preferTable = PersistentHashMap.EMPTY;
Expand All @@ -384,7 +384,7 @@ public MultiFn reset()
}
finally
{
_rw.ExitWriteLock();
// _rw.ExitWriteLock();
}
}

Expand Down Expand Up @@ -787,7 +787,7 @@ private void Dispose(bool disposing)
{
if (disposing)
{
((IDisposable)_rw).Dispose();
// ((IDisposable)_rw).Dispose();
}

_disposed = true;
Expand Down
4 changes: 2 additions & 2 deletions Clojure/Clojure/Lib/RT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3407,8 +3407,8 @@ static IEnumerable<string> GetFindFilePaths()

static IEnumerable<string> GetFindFilePathsRaw()
{
yield return System.AppDomain.CurrentDomain.BaseDirectory;
yield return Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "bin");
yield return System.Environment.CurrentDirectory;
yield return Path.Combine(System.Environment.CurrentDirectory, "bin");
yield return Directory.GetCurrentDirectory();
yield return Path.GetDirectoryName(typeof(RT).Assembly.Location);

Expand Down
Loading