* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
-#include "config.h"
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define debug_yield_read()
#endif
#include <urcu.h>
}
for (;;) {
+ int v;
+
pthread_mutex_lock(&lock);
- assert(test_array.a == 8);
+ v = test_array.a;
+ assert(v == 8);
if (caa_unlikely(rduration))
loop_sleep(rduration);
pthread_mutex_unlock(&lock);
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
- printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
- case 'r':
- yield_active |= YIELD_READ;
- break;
- case 'w':
- yield_active |= YIELD_WRITE;
- break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);