Skip to content

Commit f682e40

Browse files
committed
ch4/proc: Add lock when creating new av tables
Multiple threads could call be creating dynamic processes concurrently, so this needs protection.
1 parent 9e1e23c commit f682e40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mpid/ch4/src/ch4_proc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ int MPIDIU_new_avt(int size, int *avtid)
9191
MPIR_FUNC_ENTER;
9292
MPL_DBG_MSG_FMT(MPIDI_CH4_DBG_GENERAL, VERBOSE, (MPL_DBG_FDEST, " new_avt: size=%d", size));
9393

94+
MPID_THREAD_CS_ENTER(VCI, MPIDIU_THREAD_DYNPROC_MUTEX);
95+
9496
*avtid = get_next_avtid();
9597

9698
/* note: zeroed so is_local default to 0, which is true for *avtid > 0 */
@@ -102,6 +104,8 @@ int MPIDIU_new_avt(int size, int *avtid)
102104
}
103105
MPIDI_global.avt_mgr.av_tables[*avtid] = new_av_table;
104106

107+
MPID_THREAD_CS_EXIT(VCI, MPIDIU_THREAD_DYNPROC_MUTEX);
108+
105109
MPIR_FUNC_EXIT;
106110
return mpi_errno;
107111
}

0 commit comments

Comments
 (0)