Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
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
Levin Zimmermann
go-fuse
Commits
ae405425
Commit
ae405425
authored
Jul 18, 2017
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
splice: use Go style naming for pairPool.
parent
6aa09dea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
splice/pool.go
splice/pool.go
+29
-29
No files found.
splice/pool.go
View file @
ae405425
...
...
@@ -47,46 +47,46 @@ func newSplicePairPool() *pairPool {
return
&
pairPool
{}
}
func
(
me
*
pairPool
)
clear
()
{
me
.
Lock
()
for
_
,
p
:=
range
me
.
unused
{
func
(
pp
*
pairPool
)
clear
()
{
pp
.
Lock
()
for
_
,
p
:=
range
pp
.
unused
{
p
.
Close
()
}
me
.
unused
=
me
.
unused
[
:
0
]
me
.
Unlock
()
pp
.
unused
=
pp
.
unused
[
:
0
]
pp
.
Unlock
()
}
func
(
me
*
pairPool
)
used
()
(
n
int
)
{
me
.
Lock
()
n
=
me
.
usedCount
me
.
Unlock
()
func
(
pp
*
pairPool
)
used
()
(
n
int
)
{
pp
.
Lock
()
n
=
pp
.
usedCount
pp
.
Unlock
()
return
n
}
func
(
me
*
pairPool
)
total
()
int
{
me
.
Lock
()
n
:=
me
.
usedCount
+
len
(
me
.
unused
)
me
.
Unlock
()
func
(
pp
*
pairPool
)
total
()
int
{
pp
.
Lock
()
n
:=
pp
.
usedCount
+
len
(
pp
.
unused
)
pp
.
Unlock
()
return
n
}
func
(
me
*
pairPool
)
drop
(
p
*
Pair
)
{
func
(
pp
*
pairPool
)
drop
(
p
*
Pair
)
{
p
.
Close
()
me
.
Lock
()
me
.
usedCount
--
me
.
Unlock
()
pp
.
Lock
()
pp
.
usedCount
--
pp
.
Unlock
()
}
func
(
me
*
pairPool
)
get
()
(
p
*
Pair
,
err
error
)
{
me
.
Lock
()
defer
me
.
Unlock
()
func
(
pp
*
pairPool
)
get
()
(
p
*
Pair
,
err
error
)
{
pp
.
Lock
()
defer
pp
.
Unlock
()
me
.
usedCount
++
l
:=
len
(
me
.
unused
)
pp
.
usedCount
++
l
:=
len
(
pp
.
unused
)
if
l
>
0
{
p
:=
me
.
unused
[
l
-
1
]
me
.
unused
=
me
.
unused
[
:
l
-
1
]
p
:=
pp
.
unused
[
l
-
1
]
pp
.
unused
=
pp
.
unused
[
:
l
-
1
]
return
p
,
nil
}
...
...
@@ -110,13 +110,13 @@ func discardAll(fd int) {
}
}
func
(
me
*
pairPool
)
done
(
p
*
Pair
)
{
func
(
pp
*
pairPool
)
done
(
p
*
Pair
)
{
discardAll
(
p
.
r
)
me
.
Lock
()
me
.
usedCount
--
me
.
unused
=
append
(
me
.
unused
,
p
)
me
.
Unlock
()
pp
.
Lock
()
pp
.
usedCount
--
pp
.
unused
=
append
(
pp
.
unused
,
p
)
pp
.
Unlock
()
}
func
init
()
{
...
...
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