+2008-12-07 Bruno Haible <bruno@clisp.org>
+
+ * tests/test-lock.c (test_lock, test_rwlock, test_recursive_lock,
+ test_once): Mark functions as static.
+ * tests/test-tls.c (test_tls): Likewise.
+
2008-12-07 Bruno Haible <bruno@clisp.org>
* lib/striconveha.h (uniconv_register_autodetect): Renamed from
abort ();
}
+
+/* ------------------- Test normal (non-recursive) locks ------------------- */
+
/* Test normal locks by having several bank accounts and several threads
which shuffle around money between the accounts and another thread
checking that all the money is still there. */
return NULL;
}
-void
+static void
test_lock (void)
{
int i;
check_accounts ();
}
+
+/* ----------------- Test read-write (non-recursive) locks ----------------- */
+
/* Test read-write locks by having several bank accounts and several threads
which shuffle around money between the accounts and several other threads
that check that all the money is still there. */
return NULL;
}
-void
+static void
test_rwlock (void)
{
int i;
check_accounts ();
}
+
+/* -------------------------- Test recursive locks -------------------------- */
+
/* Test recursive locks by having several bank accounts and several threads
which shuffle around money between the accounts (recursively) and another
thread checking that all the money is still there. */
return NULL;
}
-void
+static void
test_recursive_lock (void)
{
int i;
check_accounts ();
}
+
+/* ------------------------ Test once-only execution ------------------------ */
+
/* Test once-only execution by having several threads attempt to grab a
once-only task simultaneously (triggered by releasing a read-write lock). */
return NULL;
}
-void
+static void
test_once (void)
{
int i, repeat;
gl_thread_join (threads[i], NULL);
}
+
+/* -------------------------------------------------------------------------- */
+
int
main ()
{
yield ();
}
+
+/* ----------------------- Test thread-local storage ----------------------- */
+
#define KEYS_COUNT 4
static gl_tls_key_t mykeys[KEYS_COUNT];
return NULL;
}
-void
+static void
test_tls (void)
{
int pass, i;
}
}
+
+/* -------------------------------------------------------------------------- */
+
int
main ()
{