Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.hfa

    r92e7631 r71c8b7e  
    1717
    1818#include <stdbool.h>
     19#include <stdint.h>
    1920
    2021#include "invoke.h"
     
    3738void  ?{}(semaphore & this, int count = 1);
    3839void ^?{}(semaphore & this);
    39 void   P (semaphore & this);
     40bool   P (semaphore & this);
    4041bool   V (semaphore & this);
     42bool   V (semaphore & this, unsigned count);
    4143
    4244
     
    111113
    112114//-----------------------------------------------------------------------------
     115// I/O
     116struct __io_data;
     117
     118#define CFA_CLUSTER_IO_POLLER_USER_THREAD 1 << 0
     119// #define CFA_CLUSTER_IO_POLLER_KERNEL_SIDE 1 << 1
     120
     121//-----------------------------------------------------------------------------
    113122// Cluster
    114123struct cluster {
     
    141150                cluster * prev;
    142151        } node;
     152
     153        struct __io_data * io;
     154
     155        #if !defined(__CFA_NO_STATISTICS__)
     156                bool print_stats;
     157        #endif
    143158};
    144159extern Duration default_preemption();
    145160
    146 void ?{} (cluster & this, const char name[], Duration preemption_rate);
     161void ?{} (cluster & this, const char name[], Duration preemption_rate, int flags);
    147162void ^?{}(cluster & this);
    148163
    149 static inline void ?{} (cluster & this)                           { this{"Anonymous Cluster", default_preemption()}; }
    150 static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate}; }
    151 static inline void ?{} (cluster & this, const char name[])        { this{name, default_preemption()}; }
     164static inline void ?{} (cluster & this)                                      { this{"Anonymous Cluster", default_preemption(), 0}; }
     165static inline void ?{} (cluster & this, Duration preemption_rate)            { this{"Anonymous Cluster", preemption_rate, 0}; }
     166static inline void ?{} (cluster & this, const char name[])                   { this{name, default_preemption(), 0}; }
     167static inline void ?{} (cluster & this, int flags)                           { this{"Anonymous Cluster", default_preemption(), flags}; }
     168static inline void ?{} (cluster & this, Duration preemption_rate, int flags) { this{"Anonymous Cluster", preemption_rate, flags}; }
     169static inline void ?{} (cluster & this, const char name[], int flags)        { this{name, default_preemption(), flags}; }
    152170
    153171static inline [cluster *&, cluster *& ] __get( cluster & this ) __attribute__((const)) { return this.node.[next, prev]; }
     
    156174static inline struct cluster   * active_cluster  () { return TL_GET( this_processor )->cltr; }
    157175
     176#if !defined(__CFA_NO_STATISTICS__)
     177        static inline void print_stats_at_exit( cluster & this ) {
     178                this.print_stats = true;
     179        }
     180#endif
     181
    158182// Local Variables: //
    159183// mode: c //
Note: See TracChangeset for help on using the changeset viewer.