blob: b3ccad3483fde310fb277bb7c6ed9ccf59d2eed5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/*======================================================================
FILE: icaltm_test.c
SPDX-FileCopyrightText: 2017 Red Hat, Inc. <www.redhat.com>
SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
The Initial Developer of the Original Code is Milan Crha
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "libical/ical.h"
#include <pthread.h>
static icaltimezone *zone, *utc;
static void *test_tread()
{
struct icaltimetype itt;
int ii;
itt = icaltime_from_string("19710203T040506");
itt.zone = zone;
for (ii = 0; ii < 200; ii++, itt.year++) {
icaltime_convert_to_zone(itt, utc);
}
return NULL;
}
int main()
{
pthread_t thread[2];
int ii;
zone = icaltimezone_get_builtin_timezone("America/New_York");
utc = icaltimezone_get_utc_timezone();
for (ii = 0; ii < 2; ii++) {
pthread_create(&thread[ii], NULL, test_tread, NULL);
}
for (ii = 0; ii < 2; ii++) {
pthread_join(thread[ii], NULL);
}
return 0;
}
|