async.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef SCM_ASYNC_H
  2. #define SCM_ASYNC_H
  3. /* Copyright 1995-1998,2000-2002,2004-2006,2008-2009,2011,2014,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include "libguile/threads.h"
  18. #define SCM_TICK scm_async_tick ()
  19. SCM_API void scm_async_tick (void);
  20. SCM_API void scm_switch (void);
  21. SCM_API SCM scm_system_async_mark (SCM a);
  22. SCM_API SCM scm_system_async_mark_for_thread (SCM a, SCM thread);
  23. SCM_API int scm_c_prepare_to_wait_on_fd (int fd);
  24. SCM_API int scm_c_prepare_to_wait_on_cond (scm_i_pthread_mutex_t *m,
  25. scm_i_pthread_cond_t *c);
  26. SCM_API void scm_c_wait_finished (void);
  27. SCM_API SCM scm_noop (SCM args);
  28. SCM_API SCM scm_call_with_blocked_asyncs (SCM proc);
  29. SCM_API SCM scm_call_with_unblocked_asyncs (SCM proc);
  30. SCM_API void *scm_c_call_with_blocked_asyncs (void *(*p) (void *d), void *d);
  31. SCM_API void *scm_c_call_with_unblocked_asyncs (void *(*p) (void *d), void *d);
  32. SCM_API void scm_dynwind_block_asyncs (void);
  33. SCM_API void scm_dynwind_unblock_asyncs (void);
  34. SCM_INTERNAL int scm_i_prepare_to_wait (scm_thread *,
  35. struct scm_thread_wake_data *);
  36. SCM_INTERNAL void scm_i_wait_finished (scm_thread *);
  37. SCM_INTERNAL int scm_i_prepare_to_wait_on_fd (scm_thread *, int);
  38. SCM_INTERNAL int scm_i_prepare_to_wait_on_cond (scm_thread *,
  39. scm_i_pthread_mutex_t *,
  40. scm_i_pthread_cond_t *);
  41. SCM_INTERNAL void scm_i_async_push (scm_thread *t, SCM proc);
  42. SCM_INTERNAL SCM scm_i_async_pop (scm_thread *t);
  43. SCM_INTERNAL void scm_init_async (void);
  44. #endif /* SCM_ASYNC_H */