DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Implementation

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/*
	generic_threads.c
	
	A module that permits clients of the GC to supply callback functions
	for thread stack scanning.
	
	by Patrick C. Beard.
 */

#ifndef __GENERIC_THREADS__
#define __GENERIC_THREADS__

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Passed to a thread marking function, to allow it to mark a range of memory.
 */
typedef void (*GC_mark_range_proc) (char* begin, char* end);

/**
 * Generic all stack marking function.
 */
typedef void (*GC_generic_mark_all_stacks_proc) (GC_mark_range_proc marker);

extern GC_generic_mark_all_stacks_proc GC_generic_mark_all_stacks;

/**
 * Generic mutual exclusion facility.
 */
typedef void (*GC_generic_proc) (void* mutex);

extern void* GC_generic_mutex;
extern GC_generic_proc GC_generic_locker;
extern GC_generic_proc GC_generic_unlocker;
extern GC_generic_proc GC_generic_stopper;
extern GC_generic_proc GC_generic_starter;

extern void GC_generic_init_threads(GC_generic_mark_all_stacks_proc mark_all_stacks,
									void* mutex,
									GC_generic_proc locker, GC_generic_proc unlocker,
									GC_generic_proc stopper, GC_generic_proc starter);
									
#ifdef __cplusplus
}
#endif

#endif /* __GENERIC_THREADS__ */