Skip to content

Commit

Permalink
[sgen] Use SGEN_ATOMIC_ADD instead of doing it by hand.
Browse files Browse the repository at this point in the history
  • Loading branch information
schani committed Dec 9, 2012
1 parent 48aff56 commit 1df43bc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mono/metadata/sgen-workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ workers_dequeue_and_do_job (WorkerData *data)
entry->func (data, entry->data);
sgen_free_internal (entry, INTERNAL_MEM_JOB_QUEUE_ENTRY);

do {
num_finished = workers_num_jobs_finished;
} while (InterlockedCompareExchange (&workers_num_jobs_finished, num_finished + 1, num_finished) != num_finished);
SGEN_ATOMIC_ADD (workers_num_jobs_finished, 1);

return TRUE;
}
Expand Down

0 comments on commit 1df43bc

Please sign in to comment.