Changeset 6a4ef0c


Ignore:
Timestamp:
Nov 10, 2022, 12:14:23 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
a757ba1
Parents:
5ce0659
Message:

Changed cltr_link to use explicit field name to make gdb easier

Location:
libcfa/src
Files:
4 edited

Legend:

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

    r5ce0659 r6a4ef0c  
    3030#ifdef __cforall
    3131#define __cfa_anonymous_object(x) inline struct x
    32 #define __cfa_dlink1(x) dlink(x)
    33 #define __cfa_dlink2(x, name) inline struct name { inline dlink(x); }
     32#define __cfa_dlink(x) struct { inline dlink(x); }
    3433#else
    3534#define __cfa_anonymous_object(x) struct x __cfa_anonymous_object
    36 #define __cfa_dlink1(x) struct { struct x * next; struct x * back; }
    37 #define __cfa_dlink2(x, name) struct { struct x * next; struct x * back; } __dlink ## name
     35#define __cfa_dlink(x) struct { struct x * next; struct x * back; }
    3836#endif
    3937
  • libcfa/src/concurrency/invoke.h

    r5ce0659 r6a4ef0c  
    197197                // intrusive link fields, used for locks, monitors and any user defined data structure
    198198                // default link fields for dlist
    199                 __cfa_dlink1(thread$) user_link;
     199                __cfa_dlink(thread$) user_link;
    200200
    201201                // secondary intrusive link fields, used for global cluster list
    202202                // default link fields for dlist
    203                 __cfa_dlink2(thread$, cltr_link);
     203                __cfa_dlink(thread$) cltr_link;
    204204
    205205                // used to store state between clh lock/unlock
     
    244244                }
    245245
    246                 P9_EMBEDDED(thread$, thread$.cltr_link)
    247                 P9_EMBEDDED(thread$.cltr_link, dlink(thread$))
     246                static inline tytagref(typeof(((struct thread$ *)0p)->cltr_link), dlink(thread$)) ?`inner( struct thread$ & this ) {
     247                        typeof(this.cltr_link) & ib = this.cltr_link;
     248                        dlink(thread$) & b = ib`inner;
     249                        tytagref(typeof(this.cltr_link), dlink(thread$)) result = { b };
     250                        return result;
     251                }
     252
     253                P9_EMBEDDED(typeof(((struct thread$ *)0p)->cltr_link), dlink(thread$))
    248254
    249255                static inline void ?{}(__monitor_group_t & this) {
  • libcfa/src/concurrency/kernel.hfa

    r5ce0659 r6a4ef0c  
    256256        // List of threads
    257257        __spinlock_t thread_list_lock;
    258         dlist(struct thread$, thread$.cltr_link) threads;
     258        dlist(struct thread$, typeof(((struct thread$ *)0p)->cltr_link)) threads;
    259259        unsigned int nthreads;
    260260
  • libcfa/src/concurrency/kernel/startup.cfa

    r5ce0659 r6a4ef0c  
    745745        {
    746746                tytagref( dlink(thread$), dlink(thread$) ) ?`inner( thread$ & this ) = void;
    747                 with( DLINK_VIA( thread$, thread$.cltr_link ) )
     747                with( DLINK_VIA( thread$, typeof(((struct thread$ *)0p)->cltr_link) ) )
    748748                        remove( thrd );
    749749                cltr->nthreads -= 1;
Note: See TracChangeset for help on using the changeset viewer.