Unneeded read_barrier() in fio_mutex_up?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've just been going to fio code to see if I can add a wrapper to
variables being protected by read_barrier() and write_barrier() and I
came across this:

mutex.c:
242 void fio_mutex_up(struct fio_mutex *mutex)
243 {
244         int do_wake = 0;
245
246         assert(mutex->magic == FIO_MUTEX_MAGIC);
247
248         pthread_mutex_lock(&mutex->lock);
249         read_barrier();
250         if (!mutex->value && mutex->waiters)
251                 do_wake = 1;
252         mutex->value++;

What is this read_barrier() protecting? From what I can the only time
we manipulate mutex->value and mutex->waiters without being under
mutex->lock is __fio_mutex_init()...

-- 
Sitsofe | http://sucs.org/~sits/
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux