2 Copyright (C) 2000-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
28 pthread_once_t inc_var_once
= PTHREAD_ONCE_INIT
;
42 for (i
= 0; i
< 500; i
++)
43 pthread_once (&inc_var_once
, inc_var
);
49 main (int argc
, char **argv
)
53 pthread_t tid
[THREADS
];
55 for (i
= 0; i
< THREADS
; i
++)
57 err
= pthread_create (&tid
[i
], 0, thr
, 0);
59 error (1, err
, "pthread_create (%d)", i
);
62 assert (thr (0) == 0);
64 for (i
= 0; i
< THREADS
; i
++)
68 err
= pthread_join (tid
[i
], &ret
);
70 error (1, err
, "pthread_join");