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
Kirill Smelkov
go-fuse
Commits
d481cb2c
Commit
d481cb2c
authored
May 21, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use waitgroup to shutdown connection cleanly.
parent
3af5930b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
fuse/mountstate.go
fuse/mountstate.go
+8
-0
No files found.
fuse/mountstate.go
View file @
d481cb2c
...
...
@@ -4,6 +4,7 @@ import (
"log"
"os"
"strings"
"sync"
"sync/atomic"
"time"
"unsafe"
...
...
@@ -40,6 +41,9 @@ type MountState struct {
// Number of loops blocked on reading; used to control amount
// of concurrency.
readers
int32
// Number of loops total. Needed for clean shutdown.
loops
sync
.
WaitGroup
}
func
(
ms
*
MountState
)
KernelSettings
()
raw
.
InitIn
{
...
...
@@ -174,7 +178,9 @@ func (ms *MountState) recordStats(req *request) {
//
// Each filesystem operation executes in a separate goroutine.
func
(
ms
*
MountState
)
Loop
()
{
ms
.
loops
.
Add
(
1
)
ms
.
loop
()
ms
.
loops
.
Wait
()
ms
.
mountFile
.
Close
()
}
...
...
@@ -211,6 +217,7 @@ func (ms *MountState) loop() {
}
if
readers
<=
0
{
ms
.
loops
.
Add
(
1
)
go
ms
.
loop
()
}
...
...
@@ -229,6 +236,7 @@ func (ms *MountState) loop() {
}
ms
.
buffers
.
FreeBuffer
(
dest
)
ms
.
loops
.
Done
()
}
func
(
ms
*
MountState
)
handleRequest
(
req
*
request
)
{
...
...
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