File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 55 *                         reserved. 
66 * Copyright (c) 2016      Los Alamos National Security, LLC. All rights 
77 *                         reserved. 
8+  * Copyright (c) 2016      Mellanox Technologies. All rights reserved. 
89 * $COPYRIGHT$ 
910 * 
1011 * Additional copyrights may follow 
@@ -33,15 +34,16 @@ typedef struct ompi_wait_sync_t {
3334
3435#define  WAIT_SYNC_RELEASE (sync )                       \
3536    if (opal_using_threads()) {                       \
37+        while( (sync)->count >= 0 );                   \
3638       pthread_cond_destroy(&(sync)->condition);      \
3739       pthread_mutex_destroy(&(sync)->lock);          \
3840    }
3941
4042#define  WAIT_SYNC_SIGNAL (sync )                        \
4143    if (opal_using_threads()) {                       \
42-         pthread_mutex_lock (&(sync->lock));             \
43-         pthread_cond_signal(&sync->condition);         \
44-         pthread_mutex_unlock(&( sync->lock));           \
44+         pthread_cond_signal (&(sync)->condition);       \
45+         /*  pthread_cond_signal assumes wmb() */ 
46+         sync -> count   =   -1 ;                              \
4547    }
4648
4749OPAL_DECLSPEC  int  sync_wait_mt (ompi_wait_sync_t  * sync );
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments