Changeset 2965d18 in mainline for uspace/lib/c/generic/futex.c


Ignore:
Timestamp:
2018-07-30T20:15:38Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d4b7b29
Parents:
8080262
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-30 19:53:13)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-30 20:15:38)
Message:

Add debug counter for rmutex locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/futex.c

    r8080262 r2965d18  
    4343
    4444//#define DPRINTF(...) kio_printf(__VA_ARGS__)
    45 #define DPRINTF(...) ((void)0)
     45#define DPRINTF(...) dummy_printf(__VA_ARGS__)
    4646
    4747/** Initialize futex counter.
     
    8484         * They should compile to regular load/stores, but simple assignments
    8585         * would be UB by definition.
     86         * The proper ordering is ensured by the surrounding futex operation.
    8687         */
    8788
     
    9495        assert(prev_owner == NULL);
    9596        __atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED);
    96 
    97         atomic_inc(&self->futex_locks);
    9897}
    9998
     
    104103        __futex_assert_is_locked(futex, name);
    105104        __atomic_store_n(&futex->owner, NULL, __ATOMIC_RELAXED);
    106         atomic_dec(&self->futex_locks);
    107105        futex_up(futex);
    108106}
     
    117115
    118116                __atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED);
    119 
    120                 atomic_inc(&self->futex_locks);
    121117
    122118                DPRINTF("Trylock on futex %s (%p) by fibril %p succeeded.\n", name, futex, self);
     
    135131
    136132        __futex_assert_is_locked(futex, name);
    137         atomic_dec(&self->futex_locks);
    138         atomic_inc(&no->futex_locks);
    139133        __atomic_store_n(&futex->owner, new_owner, __ATOMIC_RELAXED);
    140134}
Note: See TracChangeset for help on using the changeset viewer.