changed the process list of a semaphore to a doubly linked list

This commit is contained in:
hyunghwan.chung
2016-02-29 17:26:40 +00:00
parent 55a43371d5
commit b3b9af86fd
5 changed files with 96 additions and 69 deletions

View File

@ -54,7 +54,7 @@
/* this is for gc debugging */
/*#define STIX_DEBUG_PROCESSOR*/
/*#define STIX_DEBUG_GC_001*/
#define STIX_DEBUG_GC_001
/*#define STIX_DEBUG_GC_002*/
#define STIX_DEBUG_COMP_001
/*#define STIX_DEBUG_COMP_002*/
@ -237,27 +237,6 @@
#endif
#define LIST_INIT(prefix,pl) ((pl)->prefix ## prev = (pl)->prefix ## next = (pl))
#define LIST_HEAD(prefix,pl) ((pl)->prefix ## next)
#define LIST_TAIL(prefix,pl) ((pl)->prefix ## prev)
#define LIST_NEXT(prefix,pl) ((pl)->prefix ## next)
#define LIST_PREV(prefix,pl) ((pl)->prefix ## prev)
#define LIST_ISEMPTY(prefix,pl) (LIST_HEAD(prefix,pl) == (pl))
#define LIST_CHAIN(prefix,p,x,n) do { \
stix_oop_process_t pp = (p), nn = (n); \
(x)->prefix ## prev = (p); \
(x)->prefix ## next = (n); \
nn->prefix ## prev = (x); \
pp->prefix ## next = (x); \
} while(0)
#define LIST_UNCHAIN(prefix,x) do { \
stix_oop_process_t pp = (x)->prefix ## prev, nn = (x)->prefix ## next; \
nn->prefix ## prev = pp; pp->prefix ## next = nn; \
} while (0)
#if defined(STIX_INCLUDE_COMPILER)
/* ========================================================================= */