projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2721 from ludovic-henry/fix-mono_ms_ticks
[mono.git]
/
mono
/
unit-tests
/
test-mono-linked-list-set.c
diff --git
a/mono/unit-tests/test-mono-linked-list-set.c
b/mono/unit-tests/test-mono-linked-list-set.c
index 7d5cac53085e4ff5f6148fb3a3095a0a5c4f81cd..3841581e0bb02fd61fe9f407dbcbef8891a0cea9 100644
(file)
--- a/
mono/unit-tests/test-mono-linked-list-set.c
+++ b/
mono/unit-tests/test-mono-linked-list-set.c
@@
-48,7
+48,7
@@
mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain)
static void
free_node (void *n)
{
static void
free_node (void *n)
{
- node_t *node = n;
+ node_t *node =
(node_t *)
n;
assert (node->state == STATE_BUSY);
node->state = STATE_OUT;
}
assert (node->state == STATE_BUSY);
node->state = STATE_OUT;
}
@@
-56,7
+56,7
@@
free_node (void *n)
static void*
worker (void *arg)
{
static void*
worker (void *arg)
{
- thread_data_t *thread_data = arg;
+ thread_data_t *thread_data =
(thread_data_t *)
arg;
MonoThreadHazardPointers *hp;
int skip = thread_data->skip;
int i, j;
MonoThreadHazardPointers *hp;
int skip = thread_data->skip;
int i, j;
@@
-74,11
+74,11
@@
worker (void *arg)
break;
case STATE_OUT:
if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_OUT) == STATE_OUT) {
break;
case STATE_OUT:
if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_OUT) == STATE_OUT) {
- result = mono_lls_find (&lls, hp, i);
+ result = mono_lls_find (&lls, hp, i
, HAZARD_FREE_SAFE_CTX
);
assert (!result);
mono_hazard_pointer_clear_all (hp, -1);
assert (!result);
mono_hazard_pointer_clear_all (hp, -1);
- result = mono_lls_insert (&lls, hp, &nodes [i].node);
+ result = mono_lls_insert (&lls, hp, &nodes [i].node
, HAZARD_FREE_SAFE_CTX
);
mono_hazard_pointer_clear_all (hp, -1);
assert (nodes [i].state == STATE_BUSY);
mono_hazard_pointer_clear_all (hp, -1);
assert (nodes [i].state == STATE_BUSY);
@@
-89,12
+89,12
@@
worker (void *arg)
break;
case STATE_IN:
if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_IN) == STATE_IN) {
break;
case STATE_IN:
if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_IN) == STATE_IN) {
- result = mono_lls_find (&lls, hp, i);
+ result = mono_lls_find (&lls, hp, i
, HAZARD_FREE_SAFE_CTX
);
assert (result);
assert (mono_hazard_pointer_get_val (hp, 1) == &nodes [i].node);
mono_hazard_pointer_clear_all (hp, -1);
assert (result);
assert (mono_hazard_pointer_get_val (hp, 1) == &nodes [i].node);
mono_hazard_pointer_clear_all (hp, -1);
- result = mono_lls_remove (&lls, hp, &nodes [i].node);
+ result = mono_lls_remove (&lls, hp, &nodes [i].node
, HAZARD_FREE_SAFE_CTX
);
mono_hazard_pointer_clear_all (hp, -1);
++thread_data->num_removes;
mono_hazard_pointer_clear_all (hp, -1);
++thread_data->num_removes;
@@
-126,7
+126,7
@@
main (int argc, char *argv [])
mono_threads_init (&thread_callbacks, 0);
mono_threads_init (&thread_callbacks, 0);
- mono_lls_init (&lls, free_node);
+ mono_lls_init (&lls, free_node
, HAZARD_FREE_NO_LOCK
);
for (i = 0; i < N; ++i) {
nodes [i].node.key = i;
for (i = 0; i < N; ++i) {
nodes [i].node.key = i;