+2019-06-20 Bruno Haible <bruno@clisp.org>
+
+ tls tests: Small improvements.
+ * tests/test-tls.c: Include <stdint.h>.
+ (worker_thread): Avoid gcc warning on 64-bit mingw.
+ (test_tls): Pass a different id to each thread.
+ * modules/tls-tests (Depends-on): Add stdint.
+
2019-06-20 Bruno Haible <bruno@clisp.org>
cond tests: Simplify.
/* Number of operations performed in each thread. */
#define REPEAT_COUNT 50000
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void *
worker_thread (void *arg)
{
- unsigned int id = (unsigned int) (unsigned long) arg;
+ unsigned int id = (unsigned int) (uintptr_t) arg;
int i, j, repeat;
unsigned int values[KEYS_COUNT];
/* Spawn the threads. */
for (i = 0; i < THREAD_COUNT; i++)
- threads[i] = gl_thread_create (worker_thread, NULL);
+ threads[i] = gl_thread_create (worker_thread, (void *) (uintptr_t) i);
/* Wait for the threads to terminate. */
for (i = 0; i < THREAD_COUNT; i++)