Commit 55f4b58b authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

mona_wait and mona_test now check if the request is NULL

parent d16d3801
......@@ -213,6 +213,8 @@ static inline na_return_t mona_wait_internal(mona_request_t req)
na_return_t* waited_na_ret = NULL;
na_return_t na_ret = NA_SUCCESS;
if(req == MONA_REQUEST_NULL) return NA_INVALID_ARG;
ABT_eventual_wait(req->eventual, (void**)&waited_na_ret);
na_ret = *waited_na_ret;
ABT_eventual_free(&(req->eventual));
......
......@@ -394,12 +394,14 @@ mona_msg_init_unexpected(mona_instance_t mona, void* buf, na_size_t buf_size)
na_return_t mona_wait(mona_request_t req)
{
na_return_t na_ret = mona_wait_internal(req);
free(req);
if(na_ret == NA_SUCCESS)
free(req);
return na_ret;
}
int mona_test(mona_request_t req, int* flag)
{
if(req == MONA_REQUEST_NULL) return ABT_ERR_INV_ARG;
return ABT_eventual_test(req->eventual, NULL, flag);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment