Ignore:
Timestamp:
Aug 21, 2018, 2:24:29 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
2a6292d
Parents:
2b79a70 (diff), efa8b6af (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 moved

Legend:

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

    r2b79a70 rcdbab55  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // bits/locks.h -- Fast internal locks.
     7// bits/locks.hfa -- Fast internal locks.
    88//
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 15:14:38 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 30 18:18:13 2018
    13 // Update Count     : 9
     12// Last Modified On : Sat Aug 11 15:42:24 2018
     13// Update Count     : 10
    1414//
    1515
    1616#pragma once
    1717
    18 #include "bits/debug.h"
    19 #include "bits/defs.h"
     18#include "bits/debug.hfa"
     19#include "bits/defs.hfa"
    2020#include <assert.h>
    2121
     
    5050        struct {
    5151                // Align lock on 128-bit boundary
    52                 __ALIGN__ volatile _Bool lock;
     52                __ALIGN__ volatile bool lock;
    5353        };
    5454        #ifdef __CFA_DEBUG__
     
    6464                extern void disable_interrupts();
    6565                extern void enable_interrupts_noPoll();
     66
     67                #ifdef __CFA_DEBUG__
     68                        void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name);
     69                #else
     70                        #define __cfaabi_dbg_record(x, y)
     71                #endif
    6672        }
    6773
     
    7278        }
    7379
    74 
    75         #ifdef __CFA_DEBUG__
    76                 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name);
    77         #else
    78                 #define __cfaabi_dbg_record(x, y)
    79         #endif
    80 
    8180        // Lock the spinlock, return false if already acquired
    82         static inline _Bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    83                 _Bool result = (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0);
     81        static inline bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
     82                bool result = (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0);
    8483                if( result ) {
    8584                        disable_interrupts();
Note: See TracChangeset for help on using the changeset viewer.