Changes in kernel/generic/src/proc/thread.c [897fd8f1:e7c4115d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
r897fd8f1 re7c4115d 103 103 static thread_id_t last_tid = 0; 104 104 105 static slab_cache_t *thread_ cache;105 static slab_cache_t *thread_slab; 106 106 107 107 #ifdef CONFIG_FPU 108 slab_cache_t *fpu_context_ cache;108 slab_cache_t *fpu_context_slab; 109 109 #endif 110 110 … … 169 169 thread->saved_fpu_context = NULL; 170 170 #else /* CONFIG_FPU_LAZY */ 171 thread->saved_fpu_context = slab_alloc(fpu_context_ cache, kmflags);171 thread->saved_fpu_context = slab_alloc(fpu_context_slab, kmflags); 172 172 if (!thread->saved_fpu_context) 173 return ENOMEM;173 return -1; 174 174 #endif /* CONFIG_FPU_LAZY */ 175 175 #endif /* CONFIG_FPU */ … … 199 199 #ifdef CONFIG_FPU 200 200 if (thread->saved_fpu_context) 201 slab_free(fpu_context_ cache, thread->saved_fpu_context);202 #endif 203 return ENOMEM;201 slab_free(fpu_context_slab, thread->saved_fpu_context); 202 #endif 203 return -1; 204 204 } 205 205 … … 210 210 #endif 211 211 212 return EOK;212 return 0; 213 213 } 214 214 … … 225 225 #ifdef CONFIG_FPU 226 226 if (thread->saved_fpu_context) 227 slab_free(fpu_context_ cache, thread->saved_fpu_context);227 slab_free(fpu_context_slab, thread->saved_fpu_context); 228 228 #endif 229 229 … … 241 241 242 242 atomic_set(&nrdy, 0); 243 thread_ cache= slab_cache_create("thread_t", sizeof(thread_t), 0,243 thread_slab = slab_cache_create("thread_t", sizeof(thread_t), 0, 244 244 thr_constructor, thr_destructor, 0); 245 245 246 246 #ifdef CONFIG_FPU 247 fpu_context_ cache= slab_cache_create("fpu_context_t",247 fpu_context_slab = slab_cache_create("fpu_context_t", 248 248 sizeof(fpu_context_t), FPU_CONTEXT_ALIGN, NULL, NULL, 0); 249 249 #endif … … 341 341 thread_flags_t flags, const char *name) 342 342 { 343 thread_t *thread = (thread_t *) slab_alloc(thread_ cache, 0);343 thread_t *thread = (thread_t *) slab_alloc(thread_slab, 0); 344 344 if (!thread) 345 345 return NULL; … … 457 457 */ 458 458 task_release(thread->task); 459 slab_free(thread_ cache, thread);459 slab_free(thread_slab, thread); 460 460 } 461 461 … … 548 548 * 549 549 * Threads that are blocked waiting for a synchronization primitive 550 * are woken up with a return code of E INTRif the550 * are woken up with a return code of ESYNCH_INTERRUPTED if the 551 551 * blocking call was interruptable. See waitq_sleep_timeout(). 552 552 * … … 653 653 irq_spinlock_unlock(&thread->lock, true); 654 654 655 return waitq_sleep_timeout(&thread->join_wq, usec, flags , NULL);655 return waitq_sleep_timeout(&thread->join_wq, usec, flags); 656 656 } 657 657 … … 700 700 waitq_initialize(&wq); 701 701 702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING , NULL);702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING); 703 703 } 704 704 … … 974 974 * We can safely deallocate it. 975 975 */ 976 slab_free(thread_ cache, thread);976 slab_free(thread_slab, thread); 977 977 free(kernel_uarg); 978 978 … … 1008 1008 { 1009 1009 thread_exit(); 1010 1011 /* Unreachable */ 1012 return 0; 1010 1013 } 1011 1014
Note:
See TracChangeset
for help on using the changeset viewer.