1b10db2002-10-08Martin Nilsson /*\ ||| This file is part of Pike. For copyright information see COPYRIGHT. ||| Pike is distributed under GPL, LGPL and MPL. See the file COPYING ||| for more information. ||| $Id: cyclic.h,v 1.6 2002/10/08 20:22:19 nilsson Exp $ \*/
fc33451997-10-02Fredrik Hübinette (Hubbe) #ifndef CYCLIC_H #define CYCLIC_H
b2d3e42000-12-01Fredrik Hübinette (Hubbe) #include "pike_error.h"
fc33451997-10-02Fredrik Hübinette (Hubbe) #include "threads.h" typedef struct CYCLIC { ONERROR onerr; void *th; void *id,*a,*b; void *ret; struct CYCLIC *next; } CYCLIC; #define DECLARE_CYCLIC() \ static char cyclic_identifier__; \ CYCLIC cyclic_struct__ #define BEGIN_CYCLIC(A,B) \
a850e32000-08-14Henrik Grubbström (Grubba)  begin_cyclic(&cyclic_struct__, &cyclic_identifier__, \ (void *)(ptrdiff_t)th_self(), (void *)(A), (void *)(B))
fc33451997-10-02Fredrik Hübinette (Hubbe)  #define SET_CYCLIC_RET(RET) \ cyclic_struct__.ret=(void *)(RET) #define END_CYCLIC() unlink_cyclic(&cyclic_struct__) /* Prototypes begin here */ void unlink_cyclic(CYCLIC *c); void *begin_cyclic(CYCLIC *c, void *id, void *thread, void *a, void *b); /* Prototypes end here */ #endif /* CYCLIC_H */