From c12cf2fe511e6ed9a0728c9fc43c1e5f3752a6ca Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Thu, 10 Sep 2009 10:06:22 -0400 Subject: remove concurrent heap from mainline --- include/litmus/cheap.h | 62 -------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 include/litmus/cheap.h (limited to 'include') diff --git a/include/litmus/cheap.h b/include/litmus/cheap.h deleted file mode 100644 index 39c29fb0ab..0000000000 --- a/include/litmus/cheap.h +++ /dev/null @@ -1,62 +0,0 @@ -/* cheap.h -- A concurrent heap implementation. - * - * (c) 2009 Bjoern B. Brandenburg, - * - * Based on: - * - * G. Hunt, M. Micheal, S. Parthasarath, and M. Scott - * "An efficient algorithm for concurrent priority queue heaps." - * Information Processing Letters, 60(3): 151-157, November 1996 - */ - -#ifndef CHEAP_H - -#include "linux/spinlock.h" - -#define CHEAP_EMPTY 0xffffffff -#define CHEAP_READY 0xffffff00 -#define CHEAP_ROOT 0 - -struct cheap_node { - spinlock_t lock; - - unsigned int tag; - void* value; -}; - -struct cheap { - spinlock_t lock; - - unsigned int next; - unsigned int size; - - struct cheap_node* heap; -}; - -typedef int (*cheap_prio_t)(void* a, void* b); - -void cheap_init(struct cheap* ch, - unsigned int size, - struct cheap_node* nodes); - -int cheap_insert(cheap_prio_t higher_prio, - struct cheap* ch, - void* item, - int pid); - -void* cheap_peek(struct cheap* ch); - -typedef int (*cheap_take_predicate_t)(void* ctx, void* value); - -void* cheap_take_if(cheap_take_predicate_t pred, - void* pred_ctx, - cheap_prio_t higher_prio, - struct cheap* ch); - -static inline void* cheap_take(cheap_prio_t higher_prio, - struct cheap* ch) -{ - return cheap_take_if(NULL, NULL, higher_prio, ch); -} - -#endif -- cgit v1.2.2