Skip to content

Commit 4a39a34

Browse files
committed
grequestx: retain request object until it is removed from the list
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent b3f0bc5 commit 4a39a34

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ompi/request/grequestx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static int grequestx_progress(void) {
4747
OPAL_THREAD_LOCK(&lock);
4848
if (REQUEST_COMPLETE(&request->greq_base)) {
4949
opal_list_remove_item(&requests, &request->greq_base.super.super);
50+
OBJ_RELEASE(request);
5051
completed++;
5152
}
5253
}
@@ -73,6 +74,11 @@ int ompi_grequestx_start(
7374
}
7475
((ompi_grequest_t *)*request)->greq_poll.c_poll = gpoll_fn;
7576

77+
/* prevent the request from being destroyed upon completion,
78+
* we first have to remove it from the list of active requests
79+
*/
80+
OBJ_RETAIN(((ompi_grequest_t *)*request));
81+
7682
if (!requests_initialized) {
7783
OBJ_CONSTRUCT(&requests, opal_list_t);
7884
OBJ_CONSTRUCT(&lock, opal_mutex_t);

0 commit comments

Comments
 (0)