Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e5c232e4
提交
e5c232e4
3月 27, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make file rcu_freed
上级
f9f7aaef
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
2 行删除
+11
-2
file.hh
include/file.hh
+3
-1
file.cc
kernel/file.cc
+8
-1
没有找到文件。
include/file.hh
浏览文件 @
e5c232e4
...
...
@@ -8,7 +8,7 @@
u64
namehash
(
const
strbuf
<
DIRSIZ
>&
);
struct
file
:
public
referenced
{
struct
file
:
public
referenced
,
public
rcu_freed
{
static
file
*
alloc
();
file
*
dup
();
int
stat
(
struct
stat
*
);
...
...
@@ -26,6 +26,8 @@ struct file : public referenced {
struct
inode
*
ip
;
u32
off
;
virtual
void
do_gc
(
void
);
private
:
file
();
file
&
operator
=
(
const
file
&
);
...
...
kernel/file.cc
浏览文件 @
e5c232e4
...
...
@@ -16,7 +16,8 @@ file::alloc(void)
}
file
::
file
(
void
)
:
type
(
file
::
FD_NONE
),
readable
(
0
),
writable
(
0
),
:
rcu_freed
(
"file"
),
type
(
file
::
FD_NONE
),
readable
(
0
),
writable
(
0
),
socket
(
0
),
pipe
(
nullptr
),
ip
(
nullptr
),
off
(
0
)
{
}
...
...
@@ -32,6 +33,12 @@ file::onzero(void) const
netclose
(
socket
);
else
if
(
type
!=
file
::
FD_NONE
)
panic
(
"file::close bad type"
);
gc_delayed
((
file
*
)
this
);
}
void
file
::
do_gc
(
void
)
{
delete
this
;
}
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论