Commit 487a1f08 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Use atomic definitions

parent 6b6c7c84
......@@ -18,9 +18,18 @@
*
******************************************************************************/
#include "map.h"
/* Config parameters. */
#include "../config.h"
/* Some standard headers. */
#include <stdio.h>
#include <stdlib.h>
/* This object's header. */
#include "map.h"
/* Local headers. */
#include "atomic.h"
#include "error.h"
/**
......@@ -97,7 +106,7 @@ void map_cells_plot(struct cell *c, void *data) {
void map_cellcheck(struct cell *c, void *data) {
int *count = (int *)data;
__sync_fetch_and_add(count, c->count);
atomic_add(count, c->count);
/* Loop over all parts and check if they are in the cell. */
for (int k = 0; k < c->count; k++) {
......
......@@ -38,13 +38,6 @@
#include "const.h"
#include "error.h"
/* Counter macros. */
#ifdef COUNTER
#define COUNT(c) (__sync_add_and_fetch(&queue_counter[c], 1))
#else
#define COUNT(c)
#endif
/* The counters. */
int queue_counter[queue_counter_count];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment