openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus/1.12.16-r0/dbus-1.12.16/dbus/dbus-sysdeps-unix.c
dbus_int32_t _dbus_atomic_dec(DBusAtomic* atomic)
{
#if DBUS_USE_SYNC
    return __sync_sub_and_fetch(&atomic->value, 1) + 1;
#else
    dbus_int32_t res;

    pthread_mutex_lock(&atomic_mutex);
    res = atomic->value;
    atomic->value -= 1;
    pthread_mutex_unlock(&atomic_mutex);

    return res;
#endif
}
/**
 * Atomically decrement an integer
 *
 * @param atomic pointer to the integer to decrement
 * @returns the value before decrementing
 */
Atomically decrement an integer
@param atomic pointer to the integer to decrement
@returns the value before decrementing
Atomically decrement an integer @param atomic pointer to the integer to decrement @returns the value before decrementing
dbus_int32_t _dbus_atomic_dec(DBusAtomic* atomic)
{
#if DBUS_USE_SYNC
    return __sync_sub_and_fetch(&atomic->value, 1) + 1;
#else
    dbus_int32_t res;
    pthread_mutex_lock(&atomic_mutex);
    res = atomic->value;
    atomic->value -= 1;
    pthread_mutex_unlock(&atomic_mutex);
    return res;
#endif
}
dbus_int32_t _dbus_atomic_dec ( DBusAtomic * atomic ) { #if DBUS_USE_SYNC return __sync_sub_and_fetch ( & atomic -> value , 1 ) + 1 ; #else dbus_int32_t res ; pthread_mutex_lock ( & atomic_mutex ) ; res = atomic -> value ; atomic -> value -= 1 ; pthread_mutex_unlock ( & atomic_mutex ) ; return res ; #endif }
Atomically decrement an integer
 @param atomic pointer to the integer to decrement
 @returns the value before decrementing
Atomically decrement an integer @param atomic pointer to the integer to decrement @returns the value before decrementing