benchtest.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. *
  3. *
  4. * --------------------------------------------------------------------------
  5. *
  6. * Pthreads-win32 - POSIX Threads Library for Win32
  7. * Copyright(C) 1998 John E. Bossom
  8. * Copyright(C) 1999,2005 Pthreads-win32 contributors
  9. *
  10. * Contact Email: [email protected]
  11. *
  12. * The current list of contributors is contained
  13. * in the file CONTRIBUTORS included with the source
  14. * code distribution. The list can also be seen at the
  15. * following World Wide Web location:
  16. * http://sources.redhat.com/pthreads-win32/contributors.html
  17. *
  18. * This library is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU Lesser General Public
  20. * License as published by the Free Software Foundation; either
  21. * version 2 of the License, or (at your option) any later version.
  22. *
  23. * This library is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. * Lesser General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU Lesser General Public
  29. * License along with this library in the file COPYING.LIB;
  30. * if not, write to the Free Software Foundation, Inc.,
  31. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  32. *
  33. */
  34. #include "../config.h"
  35. enum {
  36. OLD_WIN32CS,
  37. OLD_WIN32MUTEX
  38. };
  39. extern int old_mutex_use;
  40. struct old_mutex_t_ {
  41. HANDLE mutex;
  42. CRITICAL_SECTION cs;
  43. };
  44. typedef struct old_mutex_t_ * old_mutex_t;
  45. struct old_mutexattr_t_ {
  46. int pshared;
  47. };
  48. typedef struct old_mutexattr_t_ * old_mutexattr_t;
  49. extern BOOL (WINAPI *ptw32_try_enter_critical_section)(LPCRITICAL_SECTION);
  50. extern HINSTANCE ptw32_h_kernel32;
  51. #define PTW32_OBJECT_AUTO_INIT ((void *) -1)
  52. void dummy_call(int * a);
  53. void interlocked_inc_with_conditionals(int *a);
  54. void interlocked_dec_with_conditionals(int *a);
  55. int old_mutex_init(old_mutex_t *mutex, const old_mutexattr_t *attr);
  56. int old_mutex_lock(old_mutex_t *mutex);
  57. int old_mutex_unlock(old_mutex_t *mutex);
  58. int old_mutex_trylock(old_mutex_t *mutex);
  59. int old_mutex_destroy(old_mutex_t *mutex);
  60. /****************************************************************************************/