summaryrefslogtreecommitdiff
path: root/tests/benchlib.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-10-01 07:17:09 +0000
committerrpj <rpj>2004-10-01 07:17:09 +0000
commitb0cf9efa6afeb8a7dbddf124dae173a2d633c801 (patch)
tree8f208f15bd63cf69ae9e2ceb2d523296db8bca76 /tests/benchlib.c
parent531ca4db4794aab863a898b4d079ccd59b424b25 (diff)
Mutex speedups
Diffstat (limited to 'tests/benchlib.c')
-rw-r--r--tests/benchlib.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/benchlib.c b/tests/benchlib.c
index 78ec3c8..3fa7171 100644
--- a/tests/benchlib.c
+++ b/tests/benchlib.c
@@ -51,6 +51,31 @@ int old_mutex_use = OLD_WIN32CS;
BOOL (WINAPI *ptw32_try_enter_critical_section)(LPCRITICAL_SECTION) = NULL;
HINSTANCE ptw32_h_kernel32;
+void
+dummy_call(int * a)
+{
+}
+
+void
+interlocked_inc_with_conditionals(int * a)
+{
+ if (a != NULL)
+ if (InterlockedIncrement((long *) a) == -1)
+ {
+ *a = 0;
+ }
+}
+
+void
+interlocked_dec_with_conditionals(int * a)
+{
+ if (a != NULL)
+ if (InterlockedDecrement((long *) a) == -1)
+ {
+ *a = 0;
+ }
+}
+
int
old_mutex_init(old_mutex_t *mutex, const old_mutexattr_t *attr)
{