2 * Copyright (c) 2014 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This module handles all the testing for thread related functions, namely
9 * thread creation, thread destruction, and thread priorities, and also futex
10 * wait and futex wake functions.
12 * For the purposes of this test harness, much like other time related test
13 * harnesses time passes by instantly. This means that on futex wait calls with
14 * supplied timeout values, times on the threading_environment will instantly
15 * pass by and will always return ETIMEDOUT.
18 #ifndef NATIVE_CLIENT_TESTS_IRT_EXT_THREADING_H
19 #define NATIVE_CLIENT_TESTS_IRT_EXT_THREADING_H
21 struct threading_environment {
22 volatile int num_threads_created;
23 volatile int num_threads_exited;
24 volatile int num_futex_wait_calls;
25 volatile int num_futex_wake_calls;
27 volatile int last_set_thread_nice;
28 volatile int current_time;
31 void init_threading_module(void);
33 void init_threading_environment(struct threading_environment *env);
35 void activate_threading_env(struct threading_environment *env);
36 void deactivate_threading_env(void);
38 #endif /* NATIVE_CLIENT_TESTS_IRT_EXT_THREADING_H */