-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go 1.18 supplements Mutex with a TryLock method. Use this directly instead of our dumb homebrew trylock mutex when Go 1.18 is in use.
- Loading branch information
Showing
3 changed files
with
20 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) 2022, The Decred developers | ||
// See LICENSE for details. | ||
|
||
//go:build go1.18 | ||
// +build go1.18 | ||
|
||
package trylock | ||
|
||
import "sync" | ||
|
||
// Mutex is just an alias for sync.Mutex in Go 1.18 onward since TryLock() was | ||
// added to the standard library. | ||
type Mutex = sync.Mutex |