Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
e279a10e
Commit
e279a10e
authored
Jul 08, 2014
by
Jonathan Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resource lp fixes (bitfield isn't reset after rollback)
parent
7d65c113
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/util/resource-lp.c
src/util/resource-lp.c
+15
-5
No files found.
src/util/resource-lp.c
View file @
e279a10e
...
...
@@ -251,7 +251,8 @@ static void handle_resource_free_rc(
}
/* bitfield usage:
* c0 - dequeue+alloc success */
* c0 - queue was empty to begin with
* c1 - assuming !c0, alloc succeeded */
static
void
handle_resource_deq
(
resource_state
*
ns
,
tw_bf
*
b
,
...
...
@@ -259,6 +260,7 @@ static void handle_resource_deq(
tw_lp
*
lp
){
if
(
qlist_empty
(
&
ns
->
pending
[
m
->
i
.
tok
])){
/* nothing to do */
b
->
c0
=
1
;
return
;
}
...
...
@@ -267,7 +269,7 @@ static void handle_resource_deq(
int
ret
=
resource_get
(
p
->
m
.
req
,
p
->
m
.
tok
,
&
ns
->
r
);
assert
(
ret
!=
2
);
if
(
!
ret
){
b
->
c
0
=
1
;
b
->
c
1
=
1
;
/* success, dequeue (saving as rc) and send to client */
qlist_del
(
front
);
m
->
i_rc
=
p
->
m
;
...
...
@@ -291,12 +293,11 @@ static void handle_resource_deq_rc(
tw_bf
*
b
,
resource_msg
*
m
,
tw_lp
*
lp
){
if
(
qlist_empty
(
&
ns
->
pending
[
m
->
i
.
tok
])){
/* nothing to do */
if
(
b
->
c0
){
return
;
}
if
(
b
->
c
0
){
if
(
b
->
c
1
){
/* add operation back to the front of the queue */
pending_op
*
op
=
malloc
(
sizeof
(
pending_op
));
op
->
m
=
m
->
i_rc
;
...
...
@@ -376,12 +377,21 @@ void resource_rev_handler(
default:
assert
(
0
);
}
// NOTE: ross doesn't reset b in the case of multiple rollbacks...
*
(
int
*
)
b
=
0
;
}
void
resource_finalize
(
resource_state
*
ns
,
tw_lp
*
lp
){
/* Fill me in... */
struct
qlist_head
*
ent
;
qlist_for_each
(
ent
,
ns
->
pending
){
pending_op
*
op
=
qlist_entry
(
ent
,
pending_op
,
ql
);
fprintf
(
stderr
,
"WARNING: resource LP %lu has a pending allocation
\n
"
,
lp
->
gid
);
}
}
/**** END IMPLEMENTATIONS ****/
...
...
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