diff options
author | rpj <rpj> | 2004-10-01 07:17:09 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-10-01 07:17:09 +0000 |
commit | b0cf9efa6afeb8a7dbddf124dae173a2d633c801 (patch) | |
tree | 8f208f15bd63cf69ae9e2ceb2d523296db8bca76 /tests/benchlib.c | |
parent | 531ca4db4794aab863a898b4d079ccd59b424b25 (diff) |
Mutex speedups
Diffstat (limited to 'tests/benchlib.c')
-rw-r--r-- | tests/benchlib.c | 25 |
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) { |