factory
threadsupport.cc
Go to the documentation of this file.
1
#include <string.h>
2
#include <stdlib.h>
3
4
#ifdef __cplusplus
5
extern
"C"
{
6
#endif
7
8
typedef
struct
InitList
{
9
struct
InitList
*
next
;
10
void (*
func
)();
11
}
InitList
;
12
13
static
InitList
*
inits
;
14
15
void
pSingular_initialize_thread
() {
16
InitList
*list =
inits
;
17
while
(list) {
18
list->
func
();
19
list = list->
next
;
20
}
21
}
22
23
void
pSingular_register_init
(
void
(*
f
)()) {
24
InitList
*
next
= (
InitList
*)
malloc
(
sizeof
(
InitList
));
25
next->
next
=
inits
;
26
next->
func
=
f
;
27
inits =
next
;
28
(*f)();
29
}
30
31
void
pSingular_init_var
(
void
*
s
,
void
*t,
long
n) {
32
memcpy(s, t, n);
33
}
34
35
void
*
pSingular_alloc_var
(
long
n) {
36
return
malloc
(n);
37
}
38
39
#ifdef __cplusplus
40
}
41
#endif
s
const CanonicalForm int s
Definition:
facAbsFact.cc:55
InitList
Definition:
threadsupport.cc:8
pSingular_initialize_thread
void pSingular_initialize_thread()
Definition:
threadsupport.cc:15
InitList::func
void(* func)()
Definition:
threadsupport.cc:10
inits
static InitList * inits
Definition:
threadsupport.cc:13
malloc
void * malloc(size_t size)
Definition:
omalloc.c:92
f
FILE * f
Definition:
checklibs.c:9
InitList::next
struct InitList * next
Definition:
threadsupport.cc:9
pSingular_init_var
void pSingular_init_var(void *s, void *t, long n)
Definition:
threadsupport.cc:31
pSingular_alloc_var
void * pSingular_alloc_var(long n)
Definition:
threadsupport.cc:35
pSingular_register_init
void pSingular_register_init(void(*f)())
Definition:
threadsupport.cc:23
Generated on Sat Nov 9 2019 17:00:18 by
doxygen 1.8.13
for
Singular debian-1:4.1.2-p1+ds-1