Skip to content

Commit

Permalink
Build project on azure devops
Browse files Browse the repository at this point in the history
Fixed a crash in JobManager
  • Loading branch information
Stefan Kürzeder committed Jul 25, 2019
1 parent 61032fd commit d661695
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 85 deletions.
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

38 changes: 38 additions & 0 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
stages:
- stage: Build
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: chmod +x utils/premake5 && utils/premake5 gmake
displayName: 'Generate Makefile'
- script: cd Build && make -j 3 CXX=g++-7 CC=gcc-7 config=release_x64
displayName: 'Build project'
- script: mv $(Build.SourcesDirectory)/Bin/Release/libml_pathfind.so $(Build.SourcesDirectory)/Bin/Release/ml_pathfind.so
- publish: '$(Build.SourcesDirectory)/Bin/Release/ml_pathfind.so'
artifact: 'ml_pathfind_linux'
- job: Windows
pool:
vmImage: 'windows-2019'
strategy:
maxParallel: 2
matrix:
Win32:
platform: 'win32'
x64:
platform: 'x64'
variables:
solution: 'Build/pathfind.sln'
buildConfiguration: 'Release'
steps:
- script: utils\premake5 vs2019
displayName: 'Create Visual Studio 2019 Solution'
- task: VSBuild@1
inputs:
solution: '$(solution)'
configuration: '$(buildConfiguration)'
platform: '$(platform)'
- script: move /Y $(Build.SourcesDirectory)\Bin\Release\ml_pathfind.dll $(Build.SourcesDirectory)\Bin\Release\ml_pathfind_$(platform).dll
- publish: '$(Build.SourcesDirectory)\Bin\Release\ml_pathfind_$(platform).dll'
artifact: 'ml_pathfind_$(platform)'
2 changes: 1 addition & 1 deletion module/CFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ int CFunctions::GetNodeNeighbors(lua_State* luaVM)
Utils::GetNodeNeighbors(luaVM, node, depth);

return 1;
}
}
8 changes: 4 additions & 4 deletions module/JobManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class JobManager

void PushTask(Task task, TaskCompleteCallback completeCallback)
{
std::lock_guard<std::mutex> lock{ _mutex };
std::lock_guard<std::recursive_mutex> lock{ _mutex };

_tasks.push({ task, completeCallback });
}
Expand All @@ -68,14 +68,14 @@ class JobManager
TaskResult result = task.first();

// Put result into completed tasks list
std::lock_guard<std::mutex> lock{ _mutex };
std::lock_guard<std::recursive_mutex> lock{ _mutex };
_completedTasks.push_back({ result, task.second });
}
}

void SpreadResults()
{
std::lock_guard<std::mutex> lock{ _mutex };
std::lock_guard<std::recursive_mutex> lock{ _mutex };

if (_completedTasks.empty())
return;
Expand All @@ -96,5 +96,5 @@ class JobManager
std::queue<std::pair<Task, TaskCompleteCallback>> _tasks;
std::list<std::pair<TaskResult, TaskCompleteCallback>> _completedTasks;

std::mutex _mutex;
std::recursive_mutex _mutex;
};
1 change: 1 addition & 0 deletions module/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project "module"
language "C++"
cppdialect "C++14"
kind "SharedLib"
targetname "ml_pathfind"

Expand Down
1 change: 1 addition & 0 deletions pathfind/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project "pathfind"
language "C++"
cppdialect "C++14"
kind "StaticLib"

vpaths {
Expand Down
2 changes: 0 additions & 2 deletions premake.bat

This file was deleted.

Binary file removed premake5
Binary file not shown.
Binary file removed premake5.exe
Binary file not shown.
1 change: 0 additions & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ solution "PathFind"
startproject "test"
targetdir "Bin/%{cfg.buildcfg}"

flags { "C++14" }
platforms { "x86", "x64" }
pic "On"
symbols "On"
Expand Down
1 change: 1 addition & 0 deletions test/premake5.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project "test"
language "C++"
cppdialect "C++14"
kind "ConsoleApp"

links { "pathfind" }
Expand Down
Binary file added utils/premake5
Binary file not shown.
Binary file added utils/premake5-macos
Binary file not shown.
Binary file added utils/premake5.exe
Binary file not shown.

0 comments on commit d661695

Please sign in to comment.