Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
thallium
Commits
ef51919d
Commit
ef51919d
authored
Aug 08, 2018
by
Matthieu Dorier
Browse files
corrected bug with async_response's reference to callable_remote_procedure
parent
50e6f7bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/thallium/async_response.hpp
View file @
ef51919d
...
...
@@ -30,7 +30,7 @@ private:
margo_request
m_request
;
engine
*
m_engine
;
callable_remote_procedure
&
m_rpc
;
hg_handle_t
m_handle
;
buffer
m_buffer
;
bool
m_ignore_response
;
...
...
@@ -43,11 +43,20 @@ private:
* @param c callable_remote_procedure that created the async_response.
* @param ignore_resp whether response should be ignored.
*/
async_response
(
margo_request
req
,
engine
&
e
,
callable_remote_procedure
&
c
,
bool
ignore_resp
)
:
m_request
(
req
),
m_engine
(
&
e
),
m_rpc
(
c
),
m_ignore_response
(
ignore_resp
)
{}
async_response
(
margo_request
req
,
engine
&
e
,
hg_handle_t
handle
,
bool
ignore_resp
)
:
m_request
(
req
),
m_engine
(
&
e
),
m_handle
(
handle
),
m_ignore_response
(
ignore_resp
)
{
margo_ref_incr
(
handle
);
}
public:
/**
* @brief Destructor.
*/
~
async_response
()
{
margo_destroy
(
m_handle
);
}
/**
* @brief Waits for the async_response to be ready and returns
* a packed_response when the response has been received.
...
...
include/thallium/callable_remote_procedure.hpp
View file @
ef51919d
...
...
@@ -89,7 +89,7 @@ private:
ret
=
margo_provider_iforward
(
m_provider_id
,
m_handle
,
const_cast
<
void
*>
(
static_cast
<
const
void
*>
(
&
buf
)),
&
req
);
MARGO_ASSERT
(
ret
,
margo_iforward
);
return
async_response
(
req
,
*
m_engine
,
*
this
,
m_ignore_response
);
return
async_response
(
req
,
*
m_engine
,
m_handle
,
m_ignore_response
);
}
public:
...
...
src/async_response.cpp
View file @
ef51919d
...
...
@@ -14,9 +14,9 @@ packed_response async_response::wait() {
MARGO_ASSERT
(
ret
,
margo_wait
);
buffer
output
;
if
(
m_ignore_response
)
return
packed_response
(
std
::
move
(
output
),
*
m_engine
);
ret
=
margo_get_output
(
m_
rpc
.
m_
handle
,
&
output
);
ret
=
margo_get_output
(
m_handle
,
&
output
);
MARGO_ASSERT
(
ret
,
margo_get_output
);
ret
=
margo_free_output
(
m_
rpc
.
m_
handle
,
&
output
);
// won't do anything on a buffer type
ret
=
margo_free_output
(
m_handle
,
&
output
);
// won't do anything on a buffer type
MARGO_ASSERT
(
ret
,
margo_free_output
);
return
packed_response
(
std
::
move
(
output
),
*
m_engine
);
}
...
...
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