Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
ea6e3709
Commit
ea6e3709
authored
17 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
i cannot prove that release before wakeup is wrong, but i cannot convince myself it is right either
parent
4bc5056c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pipe.c
+2
-8
2 additions, 8 deletions
pipe.c
with
2 additions
and
8 deletions
pipe.c
+
2
−
8
View file @
ea6e3709
...
...
@@ -64,7 +64,6 @@ void
pipe_close
(
struct
pipe
*
p
,
int
writable
)
{
acquire
(
&
p
->
lock
);
if
(
writable
){
p
->
writeopen
=
0
;
wakeup
(
&
p
->
readp
);
...
...
@@ -72,7 +71,6 @@ pipe_close(struct pipe *p, int writable)
p
->
readopen
=
0
;
wakeup
(
&
p
->
writep
);
}
release
(
&
p
->
lock
);
if
(
p
->
readopen
==
0
&&
p
->
writeopen
==
0
)
...
...
@@ -86,7 +84,6 @@ pipe_write(struct pipe *p, char *addr, int n)
int
i
;
acquire
(
&
p
->
lock
);
for
(
i
=
0
;
i
<
n
;
i
++
){
while
(((
p
->
writep
+
1
)
%
PIPESIZE
)
==
p
->
readp
){
if
(
p
->
readopen
==
0
||
cp
->
killed
){
...
...
@@ -99,9 +96,8 @@ pipe_write(struct pipe *p, char *addr, int n)
p
->
data
[
p
->
writep
]
=
addr
[
i
];
p
->
writep
=
(
p
->
writep
+
1
)
%
PIPESIZE
;
}
release
(
&
p
->
lock
);
wakeup
(
&
p
->
readp
);
release
(
&
p
->
lock
);
return
i
;
}
...
...
@@ -111,7 +107,6 @@ pipe_read(struct pipe *p, char *addr, int n)
int
i
;
acquire
(
&
p
->
lock
);
while
(
p
->
readp
==
p
->
writep
){
if
(
p
->
writeopen
==
0
||
cp
->
killed
){
release
(
&
p
->
lock
);
...
...
@@ -125,8 +120,7 @@ pipe_read(struct pipe *p, char *addr, int n)
addr
[
i
]
=
p
->
data
[
p
->
readp
];
p
->
readp
=
(
p
->
readp
+
1
)
%
PIPESIZE
;
}
release
(
&
p
->
lock
);
wakeup
(
&
p
->
writep
);
release
(
&
p
->
lock
);
return
i
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment