My Project: dynamics.mod/NewtonDynamics/source/pthreads.2/tests/benchtest.h Source File

My Project

benchtest.h
Go to the documentation of this file.
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: rpj@callisto.canberra.edu.au
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
32 *
33 */
34
35 #include "../config.h"
36
37 enum {
38 OLD_WIN32CS,
39 OLD_WIN32MUTEX
40 };
41
42 extern int old_mutex_use;
43
44 struct old_mutex_t_ {
45 HANDLE mutex;
46 CRITICAL_SECTION cs;
47 };
48
49 typedef struct old_mutex_t_ * old_mutex_t;
50
51 struct old_mutexattr_t_ {
52 int pshared;
53 };
54
55 typedef struct old_mutexattr_t_ * old_mutexattr_t;
56
57 extern BOOL (WINAPI *ptw32_try_enter_critical_section)(LPCRITICAL_SECTION);
58 extern HINSTANCE ptw32_h_kernel32;
59
60 #define PTW32_OBJECT_AUTO_INIT ((void *) -1)
61
62 void dummy_call(int * a);
63 void interlocked_inc_with_conditionals(int *a);
64 void interlocked_dec_with_conditionals(int *a);
65 int old_mutex_init(old_mutex_t *mutex, const old_mutexattr_t *attr);
66 int old_mutex_lock(old_mutex_t *mutex);
67 int old_mutex_unlock(old_mutex_t *mutex);
68 int old_mutex_trylock(old_mutex_t *mutex);
69 int old_mutex_destroy(old_mutex_t *mutex);
70 /****************************************************************************************/
interlocked_dec_with_conditionals
void interlocked_dec_with_conditionals(int *a)
Definition: benchlib.c:70
old_mutex_lock
int old_mutex_lock(old_mutex_t *mutex)
Definition: benchlib.c:183
old_mutex_use
int old_mutex_use
Definition: benchlib.c:49
old_mutex_destroy
int old_mutex_destroy(old_mutex_t *mutex)
Definition: benchlib.c:308
old_mutexattr_t_::pshared
int pshared
Definition: benchtest.h:52
HANDLE
#define HANDLE
Definition: pthread.h:308
dummy_call
void dummy_call(int *a)
Definition: benchlib.c:55
old_mutex_t_::mutex
HANDLE mutex
Definition: benchtest.h:45
old_mutex_t_::cs
CRITICAL_SECTION cs
Definition: benchtest.h:46
BOOL
BOOL(WINAPI *ptw32_try_enter_critical_section)(LPCRITICAL_SECTION)
OLD_WIN32MUTEX
Definition: benchtest.h:39
old_mutex_trylock
int old_mutex_trylock(old_mutex_t *mutex)
Definition: benchlib.c:255
old_mutexattr_t_
Definition: benchtest.h:51
ptw32_h_kernel32
HINSTANCE ptw32_h_kernel32
Definition: benchlib.c:52
old_mutex_init
int old_mutex_init(old_mutex_t *mutex, const old_mutexattr_t *attr)
Definition: benchlib.c:80
old_mutex_t_
Definition: benchtest.h:44
old_mutex_unlock
int old_mutex_unlock(old_mutex_t *mutex)
Definition: benchlib.c:222
old_mutexattr_t
struct old_mutexattr_t_ * old_mutexattr_t
Definition: benchtest.h:55
interlocked_inc_with_conditionals
void interlocked_inc_with_conditionals(int *a)
Definition: benchlib.c:60
old_mutex_t
struct old_mutex_t_ * old_mutex_t
Definition: benchtest.h:49
OLD_WIN32CS
Definition: benchtest.h:38