diff --git a/prov/util/src/util_ep.c b/prov/util/src/util_ep.c index 61906a9f202..eade45d46db 100644 --- a/prov/util/src/util_ep.c +++ b/prov/util/src/util_ep.c @@ -247,8 +247,9 @@ int ofi_endpoint_init(struct fid_domain *domain, const struct util_prov *util_pr if (util_domain->eq) ofi_ep_bind_eq(ep, util_domain->eq); - /* TODO Figure out how to optimize this lock for rdm and msg endpoints */ - ret = ofi_genlock_init(&ep->lock, OFI_LOCK_MUTEX); + ret = ofi_genlock_init(&ep->lock, + ep->domain->threading != FI_THREAD_SAFE ? + OFI_LOCK_NOOP : OFI_LOCK_MUTEX); if (ret) return ret;