Changeset 639e4fc for libcfa/src


Ignore:
Timestamp:
Nov 10, 2022, 2:19:51 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
1553a55, 71806e0
Parents:
a757ba1
Message:

Changed cluster link to use explicit type to avoid anonymous names in symbols gdb cares about

Location:
libcfa/src
Files:
4 edited

Legend:

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

    ra757ba1 r639e4fc  
    3030#ifdef __cforall
    3131#define __cfa_anonymous_object(x) inline struct x
    32 #define __cfa_dlink(x) struct { inline dlink(x); }
    3332#else
    3433#define __cfa_anonymous_object(x) struct x __cfa_anonymous_object
    35 #define __cfa_dlink(x) struct { struct x * next; struct x * back; }
    3634#endif
    3735
  • libcfa/src/concurrency/invoke.h

    ra757ba1 r639e4fc  
    146146
    147147        // Link lists fields
    148         // instrusive link field for threads
     148        // instrusive link field for threads in the ready-queue
    149149        struct __thread_desc_link {
    150150                struct thread$ * next;
    151151                volatile unsigned long long ts;
    152152        };
     153
     154        // Link lists fields
     155        // instrusive link field for threads in the user_link/cltr_link
     156        struct __thread_user_link {
     157                #ifdef __cforall
     158                        inline dlink(thread$);
     159                #else
     160                        struct thread$ * next; struct thread$ * back;
     161                #endif
     162        };
     163        _Static_assert(sizeof(struct __thread_user_link) == 2 * sizeof(struct thread$ *), "__thread_user_link should be consistent in C and Cforall");
    153164
    154165        struct thread$ {
     
    197208                // intrusive link fields, used for locks, monitors and any user defined data structure
    198209                // default link fields for dlist
    199                 __cfa_dlink(thread$) user_link;
     210                struct __thread_user_link user_link;
    200211
    201212                // secondary intrusive link fields, used for global cluster list
    202213                // default link fields for dlist
    203                 __cfa_dlink(thread$) cltr_link;
     214                struct __thread_user_link cltr_link;
    204215
    205216                // used to store state between clh lock/unlock
     
    244255                }
    245256
    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;
     257                static inline tytagref(struct __thread_user_link, dlink(thread$)) ?`inner( struct thread$ & this ) {
     258                        struct __thread_user_link & ib = this.cltr_link;
    248259                        dlink(thread$) & b = ib`inner;
    249                         tytagref(typeof(this.cltr_link), dlink(thread$)) result = { b };
     260                        tytagref(struct __thread_user_link, dlink(thread$)) result = { b };
    250261                        return result;
    251262                }
    252263
    253                 P9_EMBEDDED(typeof(((struct thread$ *)0p)->cltr_link), dlink(thread$))
     264                P9_EMBEDDED(struct __thread_user_link, dlink(thread$))
    254265
    255266                static inline void ?{}(__monitor_group_t & this) {
  • libcfa/src/concurrency/kernel.hfa

    ra757ba1 r639e4fc  
    250250        // List of threads
    251251        __spinlock_t thread_list_lock;
    252         dlist(struct thread$, typeof(((struct thread$ *)0p)->cltr_link)) threads;
     252        dlist(struct thread$, struct __thread_user_link) threads;
    253253        unsigned int nthreads;
    254254
  • libcfa/src/concurrency/kernel/startup.cfa

    ra757ba1 r639e4fc  
    377377        register_tls( proc );
    378378
    379         // io_future_t future;
    380         // eventfd_t idle_buf;
    381         // proc->idle_wctx.ftr = &future;
    382         // proc->idle_wctx.rdbuf = &idle_buf;
    383 
    384 
    385379        // SKULLDUGGERY: We want to create a context for the processor coroutine
    386380        // which is needed for the 2-step context switch. However, there is no reason
     
    737731        {
    738732                tytagref( dlink(thread$), dlink(thread$) ) ?`inner( thread$ & this ) = void;
    739                 with( DLINK_VIA( thread$, typeof(((struct thread$ *)0p)->cltr_link) ) )
     733                with( DLINK_VIA( thread$, struct __thread_user_link ) )
    740734                        remove( thrd );
    741735                cltr->nthreads -= 1;
Note: See TracChangeset for help on using the changeset viewer.