whitespace: Various style changes.

ck_pring
Samy Al Bahra 12 years ago
parent b4e9045c9b
commit 0598307186

@ -45,8 +45,7 @@ typedef struct ck_barrier_centralized_state ck_barrier_centralized_state_t;
#define CK_BARRIER_CENTRALIZED_STATE_INITIALIZER {0} #define CK_BARRIER_CENTRALIZED_STATE_INITIALIZER {0}
void ck_barrier_centralized(ck_barrier_centralized_t *, void ck_barrier_centralized(ck_barrier_centralized_t *,
ck_barrier_centralized_state_t *, ck_barrier_centralized_state_t *, unsigned int);
unsigned int);
struct ck_barrier_combining_group { struct ck_barrier_combining_group {
unsigned int k; unsigned int k;
@ -75,12 +74,11 @@ typedef struct ck_barrier_combining ck_barrier_combining_t;
void ck_barrier_combining_init(ck_barrier_combining_t *, ck_barrier_combining_group_t *); void ck_barrier_combining_init(ck_barrier_combining_t *, ck_barrier_combining_group_t *);
void ck_barrier_combining_group_init(ck_barrier_combining_t *, void ck_barrier_combining_group_init(ck_barrier_combining_t *,
ck_barrier_combining_group_t *, ck_barrier_combining_group_t *, unsigned int);
unsigned int);
void ck_barrier_combining(ck_barrier_combining_t *, void ck_barrier_combining(ck_barrier_combining_t *,
ck_barrier_combining_group_t *, ck_barrier_combining_group_t *,
ck_barrier_combining_state_t *); ck_barrier_combining_state_t *);
struct ck_barrier_dissemination_flag { struct ck_barrier_dissemination_flag {
unsigned int tflag; unsigned int tflag;
@ -95,6 +93,7 @@ struct ck_barrier_dissemination {
struct ck_barrier_dissemination_flag *flags[2]; struct ck_barrier_dissemination_flag *flags[2];
}; };
typedef struct ck_barrier_dissemination ck_barrier_dissemination_t; typedef struct ck_barrier_dissemination ck_barrier_dissemination_t;
struct ck_barrier_dissemination_state { struct ck_barrier_dissemination_state {
int parity; int parity;
unsigned int sense; unsigned int sense;
@ -103,16 +102,15 @@ struct ck_barrier_dissemination_state {
typedef struct ck_barrier_dissemination_state ck_barrier_dissemination_state_t; typedef struct ck_barrier_dissemination_state ck_barrier_dissemination_state_t;
void ck_barrier_dissemination_init(ck_barrier_dissemination_t *, void ck_barrier_dissemination_init(ck_barrier_dissemination_t *,
ck_barrier_dissemination_flag_t **, ck_barrier_dissemination_flag_t **, unsigned int);
unsigned int);
void ck_barrier_dissemination_subscribe(ck_barrier_dissemination_t *, void ck_barrier_dissemination_subscribe(ck_barrier_dissemination_t *,
ck_barrier_dissemination_state_t *); ck_barrier_dissemination_state_t *);
unsigned int ck_barrier_dissemination_size(unsigned int); unsigned int ck_barrier_dissemination_size(unsigned int);
void ck_barrier_dissemination(ck_barrier_dissemination_t *, void ck_barrier_dissemination(ck_barrier_dissemination_t *,
ck_barrier_dissemination_state_t *); ck_barrier_dissemination_state_t *);
struct ck_barrier_tournament_round { struct ck_barrier_tournament_round {
int role; int role;

@ -69,7 +69,7 @@ struct ck_hp_record {
unsigned int n_pending; unsigned int n_pending;
ck_stack_entry_t global_entry; ck_stack_entry_t global_entry;
unsigned int n_peak; unsigned int n_peak;
uint64_t n_reclamations; uint64_t n_reclamations;
} CK_CC_CACHELINE; } CK_CC_CACHELINE;
typedef struct ck_hp_record ck_hp_record_t; typedef struct ck_hp_record ck_hp_record_t;

@ -104,14 +104,14 @@
producer = ck_pr_load_uint(&ring->p_tail); \ producer = ck_pr_load_uint(&ring->p_tail); \
\ \
if (consumer == producer) \ if (consumer == producer) \
return (false); \ return false; \
\ \
ck_pr_fence_load(); \ ck_pr_fence_load(); \
*data = ring->ring[consumer & mask]; \ *data = ring->ring[consumer & mask]; \
ck_pr_fence_store(); \ ck_pr_fence_store(); \
ck_pr_store_uint(&ring->c_head, consumer + 1); \ ck_pr_store_uint(&ring->c_head, consumer + 1); \
\ \
return (true); \ return true; \
} \ } \
CK_CC_INLINE static bool \ CK_CC_INLINE static bool \
ck_ring_enqueue_spmc_##name(struct ck_ring_##name *ring, void *entry) \ ck_ring_enqueue_spmc_##name(struct ck_ring_##name *ring, void *entry) \

@ -73,8 +73,8 @@ typedef struct ck_spinlock_anderson ck_spinlock_anderson_t;
CK_CC_INLINE static void CK_CC_INLINE static void
ck_spinlock_anderson_init(struct ck_spinlock_anderson *lock, ck_spinlock_anderson_init(struct ck_spinlock_anderson *lock,
struct ck_spinlock_anderson_thread *slots, struct ck_spinlock_anderson_thread *slots,
unsigned int count) unsigned int count)
{ {
unsigned int i; unsigned int i;
@ -106,7 +106,7 @@ ck_spinlock_anderson_init(struct ck_spinlock_anderson *lock,
CK_CC_INLINE static void CK_CC_INLINE static void
ck_spinlock_anderson_lock(struct ck_spinlock_anderson *lock, ck_spinlock_anderson_lock(struct ck_spinlock_anderson *lock,
struct ck_spinlock_anderson_thread **slot) struct ck_spinlock_anderson_thread **slot)
{ {
unsigned int position, next; unsigned int position, next;
unsigned int count = lock->count; unsigned int count = lock->count;
@ -150,7 +150,7 @@ ck_spinlock_anderson_lock(struct ck_spinlock_anderson *lock,
CK_CC_INLINE static void CK_CC_INLINE static void
ck_spinlock_anderson_unlock(struct ck_spinlock_anderson *lock, ck_spinlock_anderson_unlock(struct ck_spinlock_anderson *lock,
struct ck_spinlock_anderson_thread *slot) struct ck_spinlock_anderson_thread *slot)
{ {
unsigned int position; unsigned int position;
@ -681,3 +681,4 @@ ck_spinlock_clh_unlock(struct ck_spinlock_clh **thread)
#endif /* CK_F_SPINLOCK_CLH */ #endif /* CK_F_SPINLOCK_CLH */
#endif /* _CK_SPINLOCK_H */ #endif /* _CK_SPINLOCK_H */

Loading…
Cancel
Save