Changeset 5d3d281 for libcfa/src


Ignore:
Timestamp:
Dec 11, 2024, 7:32:08 PM (7 days ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
36dfdac
Parents:
e797179
Message:

Remove autogen forward declarations, which are never needed, and cause warnings about static declarations without definitions.

Intended to fix the failing test from previous commit.

Autogen forward declarations are never needed because they do not depend on each other, much less with mutual recursion.

Consequences:

  • tests/.expect/(5 tests).(3 archs).txt: Accept generated code that lacks autogen forward declarations
  • libcfa/src/concurrency/thread.*: Remove unused dependency on destructor from constructor (via thrd_start), by splitting trait is_thread with is_basic_thread
Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/thread.cfa

    re797179 r5d3d281  
    135135//-----------------------------------------------------------------------------
    136136// Starting and stopping threads
    137 forall( T & | is_thread(T) )
     137forall( T & | is_basic_thread(T) )
    138138void __thrd_start( T & this, void (*main_p)(T &) ) {
    139139        thread$ * this_thrd = get_thread(this);
  • libcfa/src/concurrency/thread.hfa

    re797179 r5d3d281  
    2828// thread trait
    2929forall( T & )
     30trait is_basic_thread {
     31        void main(T& this);
     32        thread$ * get_thread(T& this);
     33};
     34forall( T & | is_basic_thread(T) )
    3035trait is_thread {
    3136        void ^?{}(T& mutex this);
    32         void main(T& this);
    33         thread$ * get_thread(T& this);
    3437};
    3538
     
    4750
    4851// Inline getters for threads/coroutines/monitors
    49 forall( T & | is_thread(T) )
     52forall( T & | is_basic_thread(T) )
    5053static inline coroutine$ * get_coroutine(T & this) __attribute__((const)) { return &get_thread(this)->self_cor; }
    5154
    52 forall( T & | is_thread(T) )
     55forall( T & | is_basic_thread(T) )
    5356static inline monitor$   * get_monitor  (T & this) __attribute__((const)) { return &get_thread(this)->self_mon; }
    5457
     
    6063extern struct cluster * mainCluster;
    6164
    62 forall( T & | is_thread(T) )
     65forall( T & | is_basic_thread(T) )
    6366void __thrd_start( T & this, void (*)(T &) );
    6467
Note: See TracChangeset for help on using the changeset viewer.