-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from terraform-providers/fix-deadlock
Fixing the Deadlock issue
- Loading branch information
Showing
10 changed files
with
345 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
package azurerm | ||
|
||
func azureRMUnlockMultiple(names *[]string) { | ||
// handle the case of using the same name for different kinds of resources | ||
func azureRMLockByName(name string, resourceType string) { | ||
updatedName := resourceType + "." + name | ||
armMutexKV.Lock(updatedName) | ||
} | ||
|
||
func azureRMLockMultipleByName(names *[]string, resourceType string) { | ||
for _, name := range *names { | ||
armMutexKV.Unlock(name) | ||
azureRMLockByName(name, resourceType) | ||
} | ||
} | ||
func azureRMLockMultiple(names *[]string) { | ||
|
||
func azureRMUnlockByName(name string, resourceType string) { | ||
updatedName := resourceType + "." + name | ||
armMutexKV.Unlock(updatedName) | ||
} | ||
|
||
func azureRMUnlockMultipleByName(names *[]string, resourceType string) { | ||
for _, name := range *names { | ||
armMutexKV.Lock(name) | ||
azureRMUnlockByName(name, resourceType) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.