Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
84a5a9b5
Commit
84a5a9b5
authored
Aug 22, 2012
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time: avoid data race in abs
Fixes #3967. R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/6460115
parent
2eb6a16e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/pkg/time/time.go
src/pkg/time/time.go
+3
-3
No files found.
src/pkg/time/time.go
View file @
84a5a9b5
...
...
@@ -241,10 +241,10 @@ func (t Time) IsZero() bool {
// It is called when computing a presentation property like Month or Hour.
func
(
t
Time
)
abs
()
uint64
{
l
:=
t
.
loc
if
l
==
nil
{
l
=
&
utcLoc
// Avoid function calls when possible.
if
l
==
nil
||
l
==
&
localLoc
{
l
=
l
.
get
()
}
// Avoid function call if we hit the local time cache.
sec
:=
t
.
sec
+
internalToUnix
if
l
!=
&
utcLoc
{
if
l
.
cacheZone
!=
nil
&&
l
.
cacheStart
<=
sec
&&
sec
<
l
.
cacheEnd
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment