Line data Source code
1 : /*
2 : * Copyright (c) 2014-2016 ISPRAS (http://www.ispras.ru)
3 : * Institute for System Programming of the Russian Academy of Sciences
4 : *
5 : * Licensed under the Apache License, Version 2.0 (the "License");
6 : * you may not use this file except in compliance with the License.
7 : * You may obtain a copy of the License at
8 : *
9 : * http://www.apache.org/licenses/LICENSE-2.0
10 : *
11 : * Unless required by applicable law or agreed to in writing, software
12 : * distributed under the License is distributed on an "AS IS" BASIS,
13 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 : * ee the License for the specific language governing permissions and
15 : * limitations under the License.
16 : */
17 :
18 : #include <verifier/thread.h>
19 :
20 : /* Thread type */
21 : struct ldv_thread {
22 : int identifier;
23 : void (*function)(void *);
24 : };
25 :
26 : /* Create thread */
27 : int ldv_thread_create(struct ldv_thread *ldv_thread, void (*function)(void *), void *data)
28 : {
29 0 : if (function)
30 0 : (*function)(data);
31 0 : return 0;
32 : }
33 :
34 : /* Create n threads */
35 : int ldv_thread_create_N(struct ldv_thread_set *ldv_thread_set, void (*function)(void *), void *data)
36 : {
37 : int i;
38 0 :
39 0 : if (function) {
40 0 : for (i = 0; i < ldv_thread_set->number; i++) {
41 0 : (*function)(data);
42 0 : }
43 : }
44 0 : return 0;
45 : }
46 :
47 : /* Join thread */
48 : int ldv_thread_join(struct ldv_thread *ldv_thread, void (*function)(void *))
49 : {
50 0 : return 0;
51 : }
52 :
53 : /* Join n threads */
54 : int ldv_thread_join_N(struct ldv_thread_set *ldv_thread_set, void (*function)(void *))
55 : {
56 0 : return 0;
57 : }
|