MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_adapt_user_thread_add

Function ff_adapt_user_thread_add

lib/ff_compat.c:89–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87void ff_restore_curthread(void *old_curthread);
88
89void *
90ff_adapt_user_thread_add(void *parent)
91{
92 struct thread *parent_td = (struct thread *)parent;
93
94 /* new application */
95 if (parent_td == NULL) {
96 parent_td = &thread0;
97 }
98
99 struct thread *td = malloc(sizeof(struct proc), M_TEMP, M_ZERO);
100 if (td == NULL) {
101 goto fail;
102 }
103
104 if (ff_adapt_user_proc_add(parent_td, td) < 0) {
105 free(td, M_TEMP);
106 goto fail;
107 }
108
109 return (void*)td;
110
111fail:
112 return NULL;
113}
114
115void
116ff_adapt_user_thread_exit(void *td)

Callers 2

ff_sys_forkFunction · 0.85
ff_sys_register_threadFunction · 0.85

Calls 3

mallocFunction · 0.85
ff_adapt_user_proc_addFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected