File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . IO ;
3
3
using System . Reflection ;
4
+ using System . Threading ;
4
5
using GitVersion . Configuration ;
5
6
using GitVersion . Extensions ;
6
7
using GitVersion . Logging ;
@@ -56,8 +57,15 @@ public int Execute(GitVersionOptions gitVersionOptions)
56
57
57
58
private int RunGitVersionTool ( GitVersionOptions gitVersionOptions )
58
59
{
60
+ using var mutex = new Mutex ( true , "sdfsdf" , out var acquired ) ;
61
+
59
62
try
60
63
{
64
+ if ( ! acquired )
65
+ {
66
+ mutex . WaitOne ( ) ;
67
+ }
68
+
61
69
var variables = gitVersionCalculateTool . CalculateVersionVariables ( ) ;
62
70
63
71
var configuration = configProvider . Provide ( overrideConfig : gitVersionOptions . ConfigInfo . OverrideConfig ) ;
@@ -92,6 +100,10 @@ private int RunGitVersionTool(GitVersionOptions gitVersionOptions)
92
100
}
93
101
return 1 ;
94
102
}
103
+ finally
104
+ {
105
+ mutex . ReleaseMutex ( ) ;
106
+ }
95
107
96
108
return 0 ;
97
109
}
You can’t perform that action at this time.
0 commit comments