duma_sem.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * DUMA - Red-Zone memory allocator.
  3. * Copyright (C) 2002-2005 Hayati Ayguen <h_ayguen@web.de>, Procitec GmbH
  4. * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL)
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * FILE CONTENTS:
  21. * internal header file
  22. */
  23. #ifndef DUMA_SEM_INC_H
  24. #define DUMA_SEM_INC_H
  25. #ifndef DUMA_NO_THREAD_SAFETY
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. void DUMA_init_sem(void);
  30. void DUMA_get_sem(void);
  31. int DUMA_rel_sem(int retval);
  32. #ifdef __cplusplus
  33. } /* extern "C" */
  34. #endif
  35. #define DUMA_INIT_SEMAPHORE() DUMA_init_sem()
  36. #define DUMA_GET_SEMAPHORE() DUMA_get_sem()
  37. #define DUMA_RELEASE_SEMAPHORE(x) DUMA_rel_sem(x)
  38. #else /* DUMA_NO_THREAD_SAFETY */
  39. #define DUMA_INIT_SEMAPHORE() \
  40. do { \
  41. } while (0)
  42. #define DUMA_GET_SEMAPHORE() \
  43. do { \
  44. } while (0)
  45. #define DUMA_RELEASE_SEMAPHORE(x) \
  46. do { \
  47. } while (0)
  48. #endif /* DUMA_NO_THREAD_SAFETY */
  49. #endif /* DUMA_SEM_INC_H */