Lines Matching refs:counter
63 * In the PA-RISC implementation, we have a spinlock and a counter.
64 * Readers use the lock to serialise their access to the counter (which
77 rw->counter++;
89 rw->counter--;
102 rw->counter++;
110 if (rw->counter < 0)
114 while (__raw_spin_is_locked(&rw->lock) && rw->counter >= 0)
129 if (rw->counter != 0) {
133 while (rw->counter != 0)
139 rw->counter = -1; /* mark as write-locked */
146 rw->counter = 0;
159 if (rw->counter == 0) {
160 rw->counter = -1;
178 return rw->counter >= 0;
187 return !rw->counter;