OSIncrementAtomic(), lck_mtx_lock() interoperability.
OSIncrementAtomic(), lck_mtx_lock() interoperability.
- Subject: OSIncrementAtomic(), lck_mtx_lock() interoperability.
- From: Matt Darland <email@hidden>
- Date: Wed, 15 Nov 2006 16:04:59 -0600
If I have an integer value X that is usually incremented through
OSIncrementAtomic, but in occasional cases I'm holding a mutex (via
lck_mtx_lock) to a structure that contains X, and I want to increment
X: Can I just ++X while holding the mutex and avoid also having to
call OSIncrementAtomic in those rare cases? i.e. Do OSxxxAtomic and
lck_mtx_xxx enforce the same memory coherency with respect to an
integer?
----
Thanks,
Matt Darland
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden