| 1 |
/* |
| 2 |
* Copyright (c) 1994 by Xerox Corporation. All rights reserved. |
| 3 |
* Copyright (c) 1996 by Silicon Graphics. All rights reserved. |
| 4 |
* Copyright (c) 1998 by Fergus Henderson. All rights reserved. |
| 5 |
* Copyright (c) 2000-2009 by Hewlett-Packard Development Company. |
| 6 |
* All rights reserved. |
| 7 |
* |
| 8 |
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
| 9 |
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
| 10 |
* |
| 11 |
* Permission is hereby granted to use or copy this program |
| 12 |
* for any purpose, provided the above notices are retained on all copies. |
| 13 |
* Permission to modify the code and to distribute modified code is granted, |
| 14 |
* provided the above notices are retained, and a notice that the code was |
| 15 |
* modified is included with the above copyright notice. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef GC_JAVAXFC_H |
| 19 |
#define GC_JAVAXFC_H |
| 20 |
|
| 21 |
#ifndef GC_H |
| 22 |
# include "gc.h" |
| 23 |
#endif |
| 24 |
|
| 25 |
#ifdef __cplusplus |
| 26 |
extern "C" { |
| 27 |
#endif |
| 28 |
|
| 29 |
/* |
| 30 |
* Invoke all remaining finalizers that haven't yet been run. (Since the |
| 31 |
* notifier is not called, this should be called from a separate thread.) |
| 32 |
* This function is needed for strict compliance with the Java standard, |
| 33 |
* which can make the runtime guarantee that all finalizers are run. |
| 34 |
* This is problematic for several reasons: |
| 35 |
* 1) It means that finalizers, and all methods called by them, |
| 36 |
* must be prepared to deal with objects that have been finalized in |
| 37 |
* spite of the fact that they are still referenced by statically |
| 38 |
* allocated pointer variables. |
| 39 |
* 2) It may mean that we get stuck in an infinite loop running |
| 40 |
* finalizers which create new finalizable objects, though that's |
| 41 |
* probably unlikely. |
| 42 |
* Thus this is not recommended for general use. |
| 43 |
*/ |
| 44 |
GC_API void GC_CALL GC_finalize_all(void); |
| 45 |
|
| 46 |
#ifdef GC_THREADS |
| 47 |
/* External thread suspension support. No thread suspension count */ |
| 48 |
/* (so a thread which has been suspended numerous times will be */ |
| 49 |
/* resumed with the very first call to GC_resume_thread). */ |
| 50 |
/* Acquire the allocation lock. Thread should be registered in GC */ |
| 51 |
/* (otherwise no-op, GC_is_thread_suspended returns false). */ |
| 52 |
/* Unimplemented on some platforms. Not recommended for general use. */ |
| 53 |
# ifndef GC_SUSPEND_THREAD_ID |
| 54 |
# define GC_SUSPEND_THREAD_ID void* |
| 55 |
# endif |
| 56 |
GC_API void GC_CALL GC_suspend_thread(GC_SUSPEND_THREAD_ID); |
| 57 |
GC_API void GC_CALL GC_resume_thread(GC_SUSPEND_THREAD_ID); |
| 58 |
GC_API int GC_CALL GC_is_thread_suspended(GC_SUSPEND_THREAD_ID); |
| 59 |
#endif /* GC_THREADS */ |
| 60 |
|
| 61 |
#ifdef __cplusplus |
| 62 |
} /* extern "C" */ |
| 63 |
#endif |
| 64 |
|
| 65 |
#endif /* GC_JAVAXFC_H */ |