Skip to content

Commit 2d3cffe

Browse files
xinzhao3artpol84
authored andcommitted
opal/common/ucx: replace opal_mutex_t with opal_recursive_mutex_t
Signed-off-by: Xin Zhao <xinz@mellanox.com>
1 parent aa26a72 commit 2d3cffe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

opal/mca/common/ucx/common_ucx_wpool.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ _winfo_create(opal_common_ucx_wpool_t *wpool)
5757
goto release_worker;
5858
}
5959

60-
OBJ_CONSTRUCT(&winfo->mutex, opal_mutex_t);
60+
OBJ_CONSTRUCT(&winfo->mutex, opal_recursive_mutex_t);
6161
winfo->worker = worker;
6262
winfo->endpoints = NULL;
6363
winfo->comm_size = 0;
@@ -142,7 +142,7 @@ opal_common_ucx_wpool_init(opal_common_ucx_wpool_t *wpool,
142142
return rc;
143143
}
144144

145-
OBJ_CONSTRUCT(&wpool->mutex, opal_mutex_t);
145+
OBJ_CONSTRUCT(&wpool->mutex, opal_recursive_mutex_t);
146146
OBJ_CONSTRUCT(&wpool->tls_list, opal_list_t);
147147

148148
status = ucp_config_read("MPI", NULL, &config);
@@ -399,7 +399,7 @@ opal_common_ucx_wpctx_create(opal_common_ucx_wpool_t *wpool, int comm_size,
399399

400400
WPOOL_DBG_OUT(_dbg_ctx, "ctx_create: ctx = %p\n", (void*)ctx);
401401

402-
OBJ_CONSTRUCT(&ctx->mutex, opal_mutex_t);
402+
OBJ_CONSTRUCT(&ctx->mutex, opal_recursive_mutex_t);
403403
OBJ_CONSTRUCT(&ctx->tls_workers, opal_list_t);
404404
ctx->released = 0;
405405
ctx->refcntr = 1; /* application holding the context */

opal/mca/common/ucx/common_ucx_wpool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BEGIN_C_DECLS
2222
typedef struct {
2323
/* Ref counting & locking*/
2424
int refcnt;
25-
opal_mutex_t mutex;
25+
opal_recursive_mutex_t mutex;
2626

2727
/* UCX data */
2828
ucp_context_h ucp_ctx;
@@ -42,7 +42,7 @@ typedef struct {
4242
} opal_common_ucx_wpool_t;
4343

4444
typedef struct {
45-
opal_mutex_t mutex;
45+
opal_recursive_mutex_t mutex;
4646
opal_atomic_int32_t refcntr;
4747

4848
/* the reference to a Worker pool this context belongs to*/
@@ -79,7 +79,7 @@ typedef struct {
7979
} opal_common_ucx_wpmem_t;
8080

8181
typedef struct {
82-
opal_mutex_t mutex;
82+
opal_recursive_mutex_t mutex;
8383
volatile int released;
8484
ucp_worker_h worker;
8585
ucp_ep_h *endpoints;

0 commit comments

Comments
 (0)