title: Is it possible to block reload of some assemblies selectively in Unity Editor?
body: <p>Been running into some issues with threading and Unity wherein if a thread was running in the background, and the editor calls a reload, say if you edit a script, eventually or immediately, Unity will crash or freeze.</p>
  
  <p>The issue is because all assemblies get reloaded, and therefore there is a dangling pointer for the threaded assembly/dll. </p>
  
  <p>To further complicate the problem, even if a thread has genuinely completed it's main routine, such as in the case of the running an external executable, and closing that executable, or exiting with an exit code returned, the threads are still not properly cleaned up, and can still cause crashing. Aborting, canceling, and even joining to the main thread don't work either. There's still
  something weird going on as soon as Unity reloads ALL of it's assemblies. The log files always show that Unity successfully completes the reload, but immediately after, we have the dangling pointer.</p>
  
  <p>I am aware that you can block reloading with </p>
  
  <pre><code>EditorApplication.LockReloadAssemblies();
  </code></pre>
  
  <p>, and even that you can intercept reload with a callback pre reload... But if there is a way to block reloading all together of a specific assemblies, that would solve the crashing problem.</p>
  
  <p>Much simpler would be a folder, say Plugins, where any assembly in there would never recompile. </p>
  
  <p>This problem is not about runtime / play mode, but only inside the Editor, since I am working on production tools &amp; plugins.</p>
  
  <p>Is anyone aware of a solution to this very frustrating problem?</p>