Ignore:
Timestamp:
Dec 5, 2017, 2:35:03 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
f9feab8
Parents:
9c35431 (diff), 65197c2 (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' into cleanup-dtors

File:
1 edited

Legend:

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

    r9c35431 rc13e8dc8  
    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.