Ejemplo n.º 1
0
void chpl_comm_pre_task_exit(int all) {
  if (all) {
    chpl_comm_barrier("chpl_comm_pre_task_exit");

    // Tear down the progress thread(s).  On node 0, don't proceed from
    // here until the last one has finished.
    CALL_CHECK_ZERO(pthread_mutex_lock(&progress_thread_entEx_cond_mutex));
    atomic_store_bool(&progress_threads_please_exit, true);
    CALL_CHECK_ZERO(pthread_cond_wait(&progress_thread_exit_cond,
                                      &progress_thread_entEx_cond_mutex));
    CALL_CHECK_ZERO(pthread_mutex_unlock(&progress_thread_entEx_cond_mutex));
  }
}
int main(int argc, char** argv)
{
  atomic_bool flag;

  atomic_store_bool(&flag, false);
  assert( false == atomic_exchange_bool(&flag, true) );
  assert( true == atomic_exchange_bool(&flag, true) );

  atomic_thread_fence(memory_order_seq_cst);
  atomic_signal_fence(memory_order_seq_cst);

  {
    atomic_uint_least8_t tmp;
    atomic_load_uint_least8_t(&tmp);
  }
  /*
  test(uint_least8_t);
  test(uint_least16_t);
  test(uint_least32_t);
  test(uint_least64_t);
  test(uintptr_t);
  */
  return 0;
}