Changeset 1bcbf02


Ignore:
Timestamp:
Aug 31, 2022, 11:55:47 AM (23 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
594e1db
Parents:
e5c04b9
Message:

Changed declarations using _Thread_local to use thread.
I'm fairly sure they do exactly the same, but
thread is:

  • more consistent with uC++.
  • Shorter.
  • Better documented.
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • benchmark/basic/tls_fetch_add.c

    re5c04b9 r1bcbf02  
    77// thread_local Boolean. This means the entire protocol is just to "mov" instructions making it extremely cheap.
    88
    9 _Thread_local volatile bool value;
     9__thread volatile bool value;
    1010
    1111void __attribute__((noinline)) do_call() {
  • libcfa/src/concurrency/kernel/fwd.hfa

    re5c04b9 r1bcbf02  
    3535extern "C" {
    3636        extern "Cforall" {
    37                 extern __attribute__((aligned(64))) _Thread_local struct KernelThreadData {
     37                extern __attribute__((aligned(64))) __thread struct KernelThreadData {
    3838                        struct thread$          * volatile this_thread;
    3939                        struct processor        * volatile this_processor;
  • libcfa/src/concurrency/kernel/private.hfa

    re5c04b9 r1bcbf02  
    8888#elif defined(CFA_HAVE_LINUX_RSEQ_H)
    8989        extern "Cforall" {
    90                 extern __attribute__((aligned(64))) _Thread_local volatile struct rseq __cfaabi_rseq;
     90                extern __attribute__((aligned(64))) __thread volatile struct rseq __cfaabi_rseq;
    9191        }
    9292#else
  • libcfa/src/concurrency/kernel/startup.cfa

    re5c04b9 r1bcbf02  
    133133//-----------------------------------------------------------------------------
    134134// Global state
    135 _Thread_local struct KernelThreadData __cfaabi_tls __attribute__ ((tls_model ( "initial-exec" ))) @= {
     135__thread struct KernelThreadData __cfaabi_tls __attribute__ ((tls_model ( "initial-exec" ))) @= {
    136136        NULL,                                                                                           // cannot use 0p
    137137        NULL,
     
    153153#elif defined(CFA_HAVE_LINUX_RSEQ_H)
    154154        extern "Cforall" {
    155                 __attribute__((aligned(64))) _Thread_local volatile struct rseq __cfaabi_rseq @= {
     155                __attribute__((aligned(64))) __thread volatile struct rseq __cfaabi_rseq @= {
    156156                        .cpu_id : RSEQ_CPU_ID_UNINITIALIZED,
    157157                };
  • libcfa/src/concurrency/preemption.cfa

    re5c04b9 r1bcbf02  
    666666// Kernel Signal Handlers
    667667//=============================================================================================
    668 __cfaabi_dbg_debug_do( static _Thread_local void * last_interrupt = 0; )
     668__cfaabi_dbg_debug_do( static __thread void * last_interrupt = 0; )
    669669
    670670// Context switch signal handler
  • tests/concurrent/clib_tls.c

    re5c04b9 r1bcbf02  
    1414
    1515
    16 _Thread_local int checkval = 0xBAADF00D;
     16__thread int checkval = 0xBAADF00D;
    1717
    1818void init(void * ) {
  • tests/concurrent/park/contention.cfa

    re5c04b9 r1bcbf02  
    22#include <thread.hfa>
    33
    4 _Thread_local drand48_data buffer = { 0 };
     4__thread drand48_data buffer = { 0 };
    55int myrand() {
    66        long int result;
Note: See TracChangeset for help on using the changeset viewer.