1 /* Check that __pthread_destroy_specific works correctly if it has to skip
3 Copyright (C) 2000-2021 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
29 static volatile int v
;
37 error (1, 0, "FAILED %d %d", v
, *i
);
40 printf ("%s %d\n", __FUNCTION__
, *i
);
52 for (i
= 0; i
< N_k
; i
+= 1)
54 err
= pthread_key_create (&k
[i
], &d
);
56 error (1, err
, "pthread_key_create %d", i
);
59 for (i
= 0; i
< N_k
; i
+= 1)
62 err
= pthread_setspecific (k
[i
], &k_v
[i
]);
64 error (1, err
, "pthread_setspecific %d", i
);
67 /* Delete every even key. */
68 for (i
= 0; i
< N_k
; i
+= 2)
70 err
= pthread_key_delete (k
[i
]);
72 error (1, err
, "pthread_key_delete %d", i
);
88 err
= pthread_create (&tid
, 0, test
, NULL
);
90 error (1, err
, "pthread_create");
92 err
= pthread_join (tid
, NULL
);
94 error (1, err
, "pthread_join");
97 error (1, 0, "FAILED END %d %d", v
, N_k
+ 1);