<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl>
<PackageLicense>https://opensource.org/licenses/MIT</PackageLicense>
- <PackageIconUrl>https://jpbruyere.github.io/Crow/images/crow.png</PackageIconUrl>
+ <PackageIcon>crow.png</PackageIcon>
<PackageCopyright>Copyright 2013-2019</PackageCopyright>
<PackageReleaseNotes>
</PackageReleaseNotes>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
- <NoWarn>$(NoWarn);1591</NoWarn>
+ <NoWarn>$(NoWarn);1591;1587;1570;1572;1573;1574</NoWarn>
<DefineConstants>DESIGN_MODE</DefineConstants>
<PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.6.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.6.0" />
</ItemGroup>
- <ItemGroup>
+ <ItemGroup>
+ <Content Include="$(SolutionDir)Images/crow.png" Pack="true" PackagePath="" />
<Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs;src\backends\win32\User32\Structs\RawInputDevice.cs" />
<EmbeddedResource Include="Templates\*.*">
<LogicalName>Crow.%(Filename).template</LogicalName>
<EmbeddedResource Include="Default.style" />
<EmbeddedResource Include="Icons\*.*" />
</ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
-//
-// CrowThread.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Threading;
public void Cancel(){
if (thread.IsAlive & !cancelRequested){
cancelRequested = true;
- Thread.Sleep (1);
- thread.Abort ();
+ while (thread.IsAlive)
+ Thread.Sleep (1);
thread.Join ();
}
lock (Host.IFace.CrowThreads)
/// <param name="path">path of the iml file to load</param>
public Widget Load (string path)
{
- lock (UpdateMutex) {
- Widget tmp = CreateInstance (path);
- AddWidget (tmp);
- return tmp;
- }
+ Monitor.Enter (UpdateMutex);
+
+ Widget tmp = CreateInstance (path);
+ AddWidget (tmp);
+
+ Monitor.Exit (UpdateMutex);
+ return tmp;
}
/// <summary>
/// Create an instance of a GraphicObject linked to this interface but not added to the GraphicTree
// }
// }
void cancelLoadingThread(){
- if (loadingThread != null)
- loadingThread.Cancel ();
+ if (loadingThread == null)
+ return;
+
+ bool updateMx = Monitor.IsEntered (IFace.UpdateMutex);
+ bool layoutMx = Monitor.IsEntered (IFace.LayoutMutex);
+
+ if (layoutMx)
+ Monitor.Exit (IFace.LayoutMutex);
+ if (updateMx)
+ Monitor.Exit (IFace.UpdateMutex);
+
+ loadingThread.Cancel ();
+
+ if (layoutMx)
+ Monitor.Enter (IFace.LayoutMutex);
+ if (updateMx)
+ Monitor.Enter (IFace.UpdateMutex);
+
}
void loadPage(IEnumerable _data, Group page, string _dataTest)
{
protected override void Dispose (bool disposing)
{
- if (disposing && loadingThread != null)
- loadingThread.Cancel ();
+ if (disposing)
+ cancelLoadingThread ();
base.Dispose (disposing);
}
--- /dev/null
+#!/bin/bash
+rm -fr build && find . -iname bin -o -iname obj -o -iname packages | xargs rm -rf