File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ int add_pending_remote_request(int peer_rank,
203203
204204 * preqp = NULL ;
205205
206+ ABT_mutex_lock (pending_remote_requests_abt_sync );
207+
206208 bool have_pending = check_pending_remote_request (peer_rank , gfid ,
207209 op , & preq );
208210 if (have_pending ) {
@@ -228,8 +230,6 @@ int add_pending_remote_request(int peer_rank,
228230 ret = UNIFYFS_SUCCESS ;
229231 }
230232
231- ABT_mutex_lock (pending_remote_requests_abt_sync );
232-
233233 if ((NULL != client_req ) && have_pending ) {
234234 /* add client request to pending remote */
235235 if (NULL == preq -> pending_client_reqs ) {
@@ -290,10 +290,11 @@ bool check_pending_remote_request(int peer_rank,
290290 server_rpc_e op ,
291291 p2p_request * * preqp )
292292{
293+ // NOTE: this method assumes caller has locked sync mutex
294+
293295 bool is_pending = false;
294296 p2p_request * pending ;
295297
296- ABT_mutex_lock (pending_remote_requests_abt_sync );
297298 if (NULL != pending_remote_requests ) {
298299 int num_pending = arraylist_size (pending_remote_requests );
299300 for (int i = 0 ; i < num_pending ; i ++ ) {
@@ -311,7 +312,6 @@ bool check_pending_remote_request(int peer_rank,
311312 } else {
312313 LOGERR ("pending_remote_requests is NULL!" );
313314 }
314- ABT_mutex_unlock (pending_remote_requests_abt_sync );
315315
316316 return is_pending ;
317317}
You can’t perform that action at this time.
0 commit comments