/* * Copyright (c) 2005 Hewlett-Packard Development Company, L.P. * * This file may be redistributed and/or modified under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2, or (at your option) any later version. * * It is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License in the * file COPYING for more details.
*/
#ifdefined(HAVE_CONFIG_H) # include "config.h" #endif
#include <stdio.h>
#ifdefined(__vxworks)
int main(void)
{
printf("test skipped\n"); return 0;
}
for (p = (list_element *)AO_REAL_HEAD_PTR(the_list);
p != 0;
p = (list_element *)AO_REAL_NEXT_PTR(p -> next))
{
i = p -> data; if (i > n || i <= 0)
{
fprintf(stderr, "Found erroneous list element %d\n", i);
abort();
} if (marks[i] != 0)
{
fprintf(stderr, "Found duplicate list element %d\n", i);
abort();
}
marks[i] = 1;
}
for (i = 1; i <= n; ++i) if (marks[i] != 1)
{
fprintf(stderr, "Missing list element %d\n", i);
abort();
}
}
volatile AO_t ops_performed = 0;
#ifndef LIMIT /* Total number of push/pop ops in all threads per test. */ # ifdef AO_USE_PTHREAD_DEFS # define LIMIT 20000 # else # define LIMIT 1000000 # endif #endif
#ifdef AO_HAVE_fetch_and_add # define fetch_and_add(addr, val) AO_fetch_and_add(addr, val) #else /* Fake it. This is really quite unacceptable for timing */ /* purposes. But as a correctness test, it should be OK. */
AO_INLINE AO_t fetch_and_add(volatile AO_t * addr, AO_t val)
{
AO_t result = AO_load(addr);
AO_store(addr, result + val); return result;
} #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.