Changeset 4a6da62 in mainline


Ignore:
Timestamp:
2012-07-24T14:20:54Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64be561
Parents:
5b382774
Message:

rcu: Added rcu_read_locked().

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/rcu.h

    r5b382774 r4a6da62  
    147147
    148148
    149 #ifndef member_to_inst
    150 #define member_to_inst(ptr_member, type, member_identif) \
    151         ((type*) (((void*)(ptr_member)) - ((void*)&(((type*)0)->member_identif))))
    152 #endif
    153 
    154149/** Use to assign a pointer to newly initialized data to a rcu reader
    155150 * accessible pointer.
     
    205200extern void rcu_read_lock(void);
    206201extern void rcu_read_unlock(void);
     202extern bool rcu_read_locked(void);
    207203extern void rcu_synchronize(void);
    208204extern void rcu_call(rcu_item_t *rcu_item, rcu_func_t func);
  • kernel/generic/src/synch/rcu.c

    r5b382774 r4a6da62  
    386386       
    387387        preemption_enable();
     388}
     389
     390/** Returns true if in an rcu reader section. */
     391bool rcu_read_locked(void)
     392{
     393        preemption_disable();
     394        bool locked = 0 < *CPU->rcu.pnesting_cnt;
     395        preemption_enable();
     396       
     397        return locked;
    388398}
    389399
Note: See TracChangeset for help on using the changeset viewer.