Example #1
0
 /* =========== */
 void w_acquire ()
 {
     while (atom_exchange32(&m_wlock, 1));
     while (m_rlock)
         atom_rw_barrier();
 }
Example #2
0
 /* ========= */
 void acquire ()
 {
     for (unsigned int kk = 0; atom_exchange32(&m_lock, 1); kk++)
         m_todo.yield(kk);
 }