mutex.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* libanode: the Anode C reference implementation
  2. * Copyright (C) 2009-2010 Adam Ierymenko <[email protected]>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>. */
  16. #ifndef _ANODE_MUTEX_H
  17. #define _ANODE_MUTEX_H
  18. #ifdef WINDOWS
  19. #else /* WINDOWS */
  20. #include <pthread.h>
  21. #define AnodeMutex pthread_mutex_t
  22. #define AnodeMutex_init(m) pthread_mutex_init((m),(const pthread_mutexattr_t *)0)
  23. #define AnodeMutex_destroy(m) pthread_mutex_destroy((m))
  24. #define AnodeMutex_lock(m) pthread_mutex_lock((m))
  25. #define AnodeMutex_unlock(m) pthread_mutex_unlock((m))
  26. #endif /* WINDOWS */
  27. #endif