Changes in kernel/generic/src/proc/thread.c [abf6c01:aae365bc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
rabf6c01 raae365bc 165 165 166 166 #ifdef CONFIG_FPU 167 thread->saved_fpu_context = slab_alloc(fpu_context_cache, 168 FRAME_ATOMIC | kmflags); 167 #ifdef CONFIG_FPU_LAZY 168 thread->saved_fpu_context = NULL; 169 #else /* CONFIG_FPU_LAZY */ 170 thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags); 169 171 if (!thread->saved_fpu_context) 170 172 return ENOMEM; 173 #endif /* CONFIG_FPU_LAZY */ 171 174 #endif /* CONFIG_FPU */ 172 175 … … 197 200 if (!stack_phys) { 198 201 #ifdef CONFIG_FPU 199 assert(thread->saved_fpu_context);200 slab_free(fpu_context_cache, thread->saved_fpu_context);202 if (thread->saved_fpu_context) 203 slab_free(fpu_context_cache, thread->saved_fpu_context); 201 204 #endif 202 205 return ENOMEM; … … 223 226 224 227 #ifdef CONFIG_FPU 225 assert(thread->saved_fpu_context);226 slab_free(fpu_context_cache, thread->saved_fpu_context);228 if (thread->saved_fpu_context) 229 slab_free(fpu_context_cache, thread->saved_fpu_context); 227 230 #endif 228 231 … … 339 342 thread_flags_t flags, const char *name) 340 343 { 341 thread_t *thread = (thread_t *) slab_alloc(thread_cache, FRAME_ATOMIC);344 thread_t *thread = (thread_t *) slab_alloc(thread_cache, 0); 342 345 if (!thread) 343 346 return NULL; 344 345 if (thread_create_arch(thread, flags) != EOK) {346 slab_free(thread_cache, thread);347 return NULL;348 }349 347 350 348 /* Not needed, but good for debugging */ … … 409 407 udebug_thread_initialize(&thread->udebug); 410 408 #endif 409 410 /* Might depend on previous initialization */ 411 thread_create_arch(thread); 411 412 412 413 if ((flags & THREAD_FLAG_NOATTACH) != THREAD_FLAG_NOATTACH) … … 653 654 654 655 return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL); 655 656 // FIXME: join should deallocate the thread.657 // Current code calls detach after join, that's contrary to how658 // join is used in other threading APIs.659 656 } 660 657
Note:
See TracChangeset
for help on using the changeset viewer.