My Project
Loading...
Searching...
No Matches
threadsupport.cc
Go to the documentation of this file.
1#include <string.h>
2#include <stdlib.h>
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#ifdef PSINGULAR
9typedef struct InitList {
10 struct InitList *next;
11 void (*func)();
12} InitList;
13
14static InitList *inits;
15
17 InitList *list = inits;
18 while (list) {
19 list->func();
20 list = list->next;
21 }
22}
23
24void pSingular_register_init(void (*f)()) {
25 InitList *next = (InitList *) malloc(sizeof(InitList));
26 next->next = inits;
27 next->func = f;
28 inits = next;
29 (*f)();
30}
31
32void pSingular_init_var(void *s, void *t, long n) {
33 memcpy(s, t, n);
34}
35
36void *pSingular_alloc_var(long n) {
37 return malloc(n);
38}
39
40#endif
41#ifdef __cplusplus
42}
43#endif
FILE * f
Definition: checklibs.c:9
const CanonicalForm int s
Definition: facAbsFact.cc:51
ListNode * next
Definition: janet.h:31
#define malloc
Definition: omAllocFunc.c:12
void pSingular_initialize_thread()