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
35fec6c6
Commit
35fec6c6
authored
Oct 30, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c6da1a38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+22
-11
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
35fec6c6
...
...
@@ -114,6 +114,8 @@ struct Conn {
sync
::
Mutex
_filemu
;
dict
<
Oid
,
_File
*>
_filetab
;
// {} foid -> _file
error
close
();
private:
void
_pinner
(
IContext
*
ctx
);
void
_pin1
(
PinReq
*
req
);
...
...
@@ -257,28 +259,37 @@ tuple<Conn*, error> WCFS::connect(Tid at) {
// close releases resources associated with wconn.
// XXX what happens to file mmappings?
error
Conn
::
close
(
wconn
)
{
error
Conn
::
close
(
)
{
// XXX error -> void?
Conn
&
wconn
=
*
this
;
wconn
.
_wlink
.
close
();
wconn
.
_wlink
->
close
();
// XXX err
#if 0
wconn._pinCancel()
try:
wconn._pinWG.wait()
except
Exception
as
e
:
#
canceled
-
ok
except Exception as e:
//
canceled - ok
if e is not context.canceled:
raise
#endif
// close all files - both that have no mappings and that still have opened mappings.
// XXX after file is closed mappings continue to survive, but we can no
// longer maintain consistent view.
w
ith
wconn
.
_filemu
:
for
f
in
wconn
.
_filetab
.
values
()
:
f
.
headf
.
close
()
f
.
headf
=
None
w
conn
.
_filemu
.
lock
();
defer
([
&
]()
{
wconn
.
_filemu
.
unlock
();
});
# XXX stop watching f
for
(
auto
_
:
wconn
.
_filetab
)
{
auto
f
=
_
.
second
;
f
->
headf
.
close
();
// XXX err
//f->headf = None
// XXX stop watching f
}
wconn
.
_filetab
=
None
wconn
.
_filetab
.
clear
();
return
nil
;
// XXX -> err ?
}
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
...
...
@@ -498,8 +509,8 @@ error WatchLink::_serveRX(IContext *ctx) { // XXX error -> where ?
wlink
.
_rxmu
.
lock
();
wlink
.
_rxdown
=
true
;
// don't allow new rxtab registers
wlink
.
_rxmu
.
unlock
();
for
(
auto
rxqi
:
wlink
.
_rxtab
)
{
auto
rxq
=
rxqi
.
second
;
for
(
auto
_
:
wlink
.
_rxtab
)
{
auto
rxq
=
_
.
second
;
rxq
.
close
();
}
});
...
...
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