4
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
32
32
-define(DEFAULT_TIMEOUT, ?t:minutes(10)).
34
-export([all/1, init_per_testcase/2, fin_per_testcase/2]).
34
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
35
init_per_group/2,end_per_group/2,
36
init_per_testcase/2, fin_per_testcase/2]).
36
38
-export([create_join_thread/1,
56
-include("test_server.hrl").
80
all(suite) -> tests().
52
-include_lib("test_server/include/test_server.hrl").
55
[create_join_thread, equal_tids, mutex, try_lock_mutex,
56
cond_wait, broadcast, detached_thread,
57
max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic].
59
suite() -> [{ct_hooks,[ts_install_cth]}].
67
init_per_suite(Config) ->
70
end_per_suite(_Config) ->
73
init_per_group(_GroupName, Config) ->
76
end_per_group(_GroupName, Config) ->
114
110
try_lock_mutex(Config) ->
115
111
run_case(Config, "try_lock_mutex", "").
117
recursive_mutex(doc) ->
118
["Tests recursive mutexes."];
119
recursive_mutex(suite) ->
121
recursive_mutex(Config) ->
122
run_case(Config, "recursive_mutex", "").
125
["Tests ethr_time_now by comparing time values with Erlang."];
129
run_case(Config, "time_now", "", fun (P) ->
135
113
wd_dispatch(P) ->
169
147
cond_wait(Config) ->
170
148
run_case(Config, "cond_wait", "").
172
cond_timedwait(doc) ->
173
["Tests ethr_cond_timedwait with ethr_cond_signal and ethr_cond_broadcast."];
174
cond_timedwait(suite) ->
176
cond_timedwait(Config) ->
177
run_case(Config, "cond_timedwait", "").
179
150
broadcast(doc) ->
180
151
["Tests that a ethr_cond_broadcast really wakes up all waiting threads"];
181
152
broadcast(suite) ->
195
166
max_threads(suite) ->
197
168
max_threads(Config) ->
198
run_case(Config, "max_threads", "").
201
["Tests forksafety."];
204
forksafety(Config) ->
205
run_case(Config, "forksafety", "").
208
["Tests vfork with threads."];
212
{skip, "vfork() known to hang multi-threaded applications on osf1"};
169
case {os:type(), os:version()} of
170
{{unix,darwin}, {9, _, _}} ->
171
%% For some reason pthread_create() crashes when more
172
%% threads cannot be created, instead of returning an
173
%% error code on our MacOS X Leopard machine...
174
{skipped, "MacOS X Leopard cannot cope with this test..."};
217
run_case(Config, "vfork", "").
176
run_case(Config, "max_threads", "")
220
180
["Tests thread specific data."];