javaxfc.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef GC_H
  18. # include "gc.h"
  19. #endif
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*
  24. * Invoke all remaining finalizers that haven't yet been run. (Since the
  25. * notifier is not called, this should be called from a separate thread.)
  26. * This function is needed for strict compliance with the Java standard,
  27. * which can make the runtime guarantee that all finalizers are run.
  28. * This is problematic for several reasons:
  29. * 1) It means that finalizers, and all methods called by them,
  30. * must be prepared to deal with objects that have been finalized in
  31. * spite of the fact that they are still referenced by statically
  32. * allocated pointer variables.
  33. * 2) It may mean that we get stuck in an infinite loop running
  34. * finalizers which create new finalizable objects, though that's
  35. * probably unlikely.
  36. * Thus this is not recommended for general use.
  37. */
  38. GC_API void GC_CALL GC_finalize_all(void);
  39. #ifdef GC_THREADS
  40. /* External thread suspension support. No thread suspension count */
  41. /* (so a thread which has been suspended numerous times will be */
  42. /* resumed with the very first call to GC_resume_thread). */
  43. /* Acquire the allocation lock. Thread should be registered in GC */
  44. /* (otherwise no-op, GC_is_thread_suspended returns false). */
  45. /* Unimplemented on some platforms. Not recommended for general use. */
  46. # ifndef GC_SUSPEND_THREAD_ID
  47. # define GC_SUSPEND_THREAD_ID void*
  48. # endif
  49. GC_API void GC_CALL GC_suspend_thread(GC_SUSPEND_THREAD_ID);
  50. GC_API void GC_CALL GC_resume_thread(GC_SUSPEND_THREAD_ID);
  51. GC_API int GC_CALL GC_is_thread_suspended(GC_SUSPEND_THREAD_ID);
  52. #endif /* GC_THREADS */
  53. #ifdef __cplusplus
  54. } /* extern "C" */
  55. #endif