Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
2de18e8e
Commit
2de18e8e
authored
Oct 27, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c13bd307
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
wcfs/vendor/lab.nexedi.com/kirr/neo/go/zodb/internal/weak/weak.go
...dor/lab.nexedi.com/kirr/neo/go/zodb/internal/weak/weak.go
+1
-5
No files found.
wcfs/vendor/lab.nexedi.com/kirr/neo/go/zodb/internal/weak/weak.go
View file @
2de18e8e
...
@@ -110,21 +110,17 @@ func NewRef(obj interface{}) *Ref {
...
@@ -110,21 +110,17 @@ func NewRef(obj interface{}) *Ref {
// If original object is still alive - it is returned.
// If original object is still alive - it is returned.
// If not - nil is returned.
// If not - nil is returned.
func
(
w
*
Ref
)
Get
()
(
obj
interface
{})
{
func
(
w
*
Ref
)
Get
()
(
obj
interface
{})
{
get
:=
false
w
.
mu
.
Lock
()
w
.
mu
.
Lock
()
if
w
.
state
!=
objReleased
{
if
w
.
state
!=
objReleased
{
w
.
state
=
objGot
w
.
state
=
objGot
get
=
true
}
w
.
mu
.
Unlock
()
if
get
{
time
.
Sleep
(
100
*
time
.
Nanosecond
)
time
.
Sleep
(
100
*
time
.
Nanosecond
)
// recreate interface{} from saved words.
// recreate interface{} from saved words.
// XXX do writes as pointers so that compiler emits write barriers to notify GC?
// XXX do writes as pointers so that compiler emits write barriers to notify GC?
i
:=
(
*
iface
)(
unsafe
.
Pointer
(
&
obj
))
i
:=
(
*
iface
)(
unsafe
.
Pointer
(
&
obj
))
*
i
=
w
.
iface
*
i
=
w
.
iface
}
}
w
.
mu
.
Unlock
()
return
obj
return
obj
}
}
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