Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
3c2ca152
Commit
3c2ca152
authored
Mar 31, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logic to find operations to cancel
parent
3f3ad28f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
src/margo.c
src/margo.c
+22
-2
No files found.
src/margo.c
View file @
3c2ca152
...
...
@@ -199,6 +199,8 @@ static void hg_progress_fn(void* foo)
unsigned
int
actual_count
;
struct
margo_instance
*
mid
=
(
struct
margo_instance
*
)
foo
;
size_t
size
;
struct
timespec
now
;
struct
timed_element
*
cur
;
while
(
!
mid
->
hg_progress_shutdown_flag
)
{
...
...
@@ -225,6 +227,23 @@ static void hg_progress_fn(void* foo)
}
}
clock_gettime
(
clk_id
,
&
now
);
ABT_mutex_lock
(
mid
->
timer_mutex
);
while
(
mid
->
timer_head
&&
(
mid
->
timer_head
->
expiration
.
tv_sec
<
now
.
tv_sec
||
(
mid
->
timer_head
->
expiration
.
tv_sec
==
now
.
tv_sec
&&
mid
->
timer_head
->
expiration
.
tv_nsec
<
now
.
tv_nsec
)))
{
cur
=
mid
->
timer_head
;
DL_DELETE
(
mid
->
timer_head
,
cur
);
cur
->
next
=
NULL
;
cur
->
prev
=
NULL
;
/* TODO: actually cancel here, of course */
printf
(
"FOO: I would like to cancel operation with tv_sec %ld, tv_nsec %ld
\n
"
,
(
long
)
cur
->
expiration
.
tv_sec
,
cur
->
expiration
.
tv_nsec
);
}
ABT_mutex_unlock
(
mid
->
timer_mutex
);
/* TODO: check for timeouts here. If timer_head not null, then check
* current time and compare against first element. Keep walking list
* cancelling operations until we find non-expired element.
...
...
@@ -326,9 +345,10 @@ hg_return_t margo_forward_timed(
hret
=
*
waited_hret
;
}
/* remove timer */
/* remove timer
if it is still in place
*/
ABT_mutex_lock
(
mid
->
timer_mutex
);
DL_DELETE
(
mid
->
timer_head
,
&
el
);
if
(
el
.
prev
||
el
.
next
)
DL_DELETE
(
mid
->
timer_head
,
&
el
);
ABT_mutex_unlock
(
mid
->
timer_mutex
);
ABT_eventual_free
(
&
eventual
);
...
...
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