-
- We have two layers of update macros. The top layer, UPD_IND() and
- friends perform all the work of an update. In detail:
-
- - if the closure being updated is a blocking queue, then all the
- threads waiting on the blocking queue are updated.
-
- - then the lower level updateWithIndirection() macro is invoked
- to actually replace the closure with an indirection (see below).
-
- -------------------------------------------------------------------------- */
-
-# define SEMI ;
-# define UPD_IND(updclosure, heapptr) \
- UPD_REAL_IND(updclosure,INFO_PTR(stg_IND_info),heapptr,SEMI)
-# define UPD_SPEC_IND(updclosure, ind_info, heapptr, and_then) \
- UPD_REAL_IND(updclosure,ind_info,heapptr,and_then)
-
-/* These macros have to work in both C and C--, so here's the
- * impedance matching:
- */
-#ifdef CMINUSMINUS
-#define BLOCK_BEGIN
-#define BLOCK_END
-#define INFO_PTR(info) info
-#else
-#define BLOCK_BEGIN {
-#define BLOCK_END }
-#define INFO_PTR(info) &info
-#define StgBlockingQueue_blocking_queue(closure) \
- (((StgBlockingQueue *)closure)->blocking_queue)
-#endif
-
-/* krc: there used to be an UPD_REAL_IND and an
- UPD_PERM_IND, the latter of which was used for
- ticky and cost-centre profiling.
- for now, we just have UPD_REAL_IND. */
-#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
- BLOCK_BEGIN \
- updateWithIndirection(ind_info, \
- updclosure, \
- heapptr, \
- and_then); \
- BLOCK_END
-
-/* -----------------------------------------------------------------------------
- Awaken any threads waiting on a blocking queue (BLACKHOLE_BQ).
- -------------------------------------------------------------------------- */
-
-/* -----------------------------------------------------------------------------
- Updates: lower-level macros which update a closure with an
- indirection to another closure.
-
- There are several variants of this code.
-
- PROFILING: