Changes in kernel/generic/src/proc/thread.c [e7c4115d:897fd8f1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
re7c4115d r897fd8f1 103 103 static thread_id_t last_tid = 0; 104 104 105 static slab_cache_t *thread_ slab;105 static slab_cache_t *thread_cache; 106 106 107 107 #ifdef CONFIG_FPU 108 slab_cache_t *fpu_context_ slab;108 slab_cache_t *fpu_context_cache; 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_ slab, kmflags);171 thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags); 172 172 if (!thread->saved_fpu_context) 173 return -1;173 return ENOMEM; 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_ slab, thread->saved_fpu_context);202 #endif 203 return -1;201 slab_free(fpu_context_cache, thread->saved_fpu_context); 202 #endif 203 return ENOMEM; 204 204 } 205 205 … … 210 210 #endif 211 211 212 return 0;212 return EOK; 213 213 } 214 214 … … 225 225 #ifdef CONFIG_FPU 226 226 if (thread->saved_fpu_context) 227 slab_free(fpu_context_ slab, thread->saved_fpu_context);227 slab_free(fpu_context_cache, thread->saved_fpu_context); 228 228 #endif 229 229 … … 241 241 242 242 atomic_set(&nrdy, 0); 243 thread_ slab= slab_cache_create("thread_t", sizeof(thread_t), 0,243 thread_cache = 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_ slab= slab_cache_create("fpu_context_t",247 fpu_context_cache = 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_ slab, 0);343 thread_t *thread = (thread_t *) slab_alloc(thread_cache, 0); 344 344 if (!thread) 345 345 return NULL; … … 457 457 */ 458 458 task_release(thread->task); 459 slab_free(thread_ slab, thread);459 slab_free(thread_cache, 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 SYNCH_INTERRUPTEDif the550 * are woken up with a return code of EINTR 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 );655 return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL); 656 656 } 657 657 … … 700 700 waitq_initialize(&wq); 701 701 702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING );702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING, NULL); 703 703 } 704 704 … … 974 974 * We can safely deallocate it. 975 975 */ 976 slab_free(thread_ slab, thread);976 slab_free(thread_cache, thread); 977 977 free(kernel_uarg); 978 978 … … 1008 1008 { 1009 1009 thread_exit(); 1010 1011 /* Unreachable */1012 return 0;1013 1010 } 1014 1011
Note:
See TracChangeset
for help on using the changeset viewer.