Ignore:
Timestamp:
Dec 1, 2017, 11:58:32 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
3ca540f, 86ad276
Parents:
d16d159 (diff), 3d560060 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/bits/locks.h

    rd16d159 r5da9d6a  
    1616#pragma once
    1717
     18#include "bits/debug.h"
    1819#include "bits/defs.h"
    19 
    20 #include "libhdr.h"
    2120
    2221// pause to prevent excess processor bus usage
     
    6564
    6665        // Lock the spinlock, return false if already acquired
    67         static inline _Bool try_lock  ( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     66        static inline _Bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    6867                _Bool result = __lock_test_and_test_and_set( this.lock );
    69                 LIB_DEBUG_DO(
     68                __cfaabi_dbg_debug_do(
    7069                        if( result ) {
    7170                                this.prev_name = caller;
     
    7776
    7877        // Lock the spinlock, spin if already acquired
    79         static inline void lock( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     78        static inline void lock( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    8079                #ifndef NOEXPBACK
    8180                        enum { SPIN_START = 4, SPIN_END = 64 * 1024, };
     
    9897                        #endif
    9998                }
    100                 LIB_DEBUG_DO(
     99                __cfaabi_dbg_debug_do(
    101100                        this.prev_name = caller;
    102101                        this.prev_thrd = this_thread;
     
    105104
    106105        // Lock the spinlock, spin if already acquired
    107         static inline void lock_yield( __spinlock_t & this DEBUG_CTX_PARAM2 ) {
     106        static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    108107                for ( unsigned int i = 1;; i += 1 ) {
    109108                        if ( __lock_test_and_test_and_set( this.lock ) ) break;
    110109                        yield( i );
    111110                }
    112                 LIB_DEBUG_DO(
     111                __cfaabi_dbg_debug_do(
    113112                        this.prev_name = caller;
    114113                        this.prev_thrd = this_thread;
Note: See TracChangeset for help on using the changeset viewer.