/kernel/trunk/generic/include/proc/thread.h |
---|
37,6 → 37,7 |
#include <typedefs.h> |
#include <time/timeout.h> |
#include <synch/rwlock.h> |
#include <synch/synch.h> |
#include <config.h> |
#include <adt/btree.h> |
#include <adt/list.h> |
154,6 → 155,7 |
extern void thread_sleep(__u32 sec); |
extern void thread_usleep(__u32 usec); |
#define thread_join(t) thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) |
extern int thread_join_timeout(thread_t *t, __u32 usec, int flags); |
extern void thread_detach(thread_t *t); |
/kernel/trunk/generic/include/mm/slab.h |
---|
78,7 → 78,7 |
link_t link; |
/* Configuration */ |
size_t size; /**< Size of SLAB position - align_up(sizeof(obj)) */ |
size_t size; /**< Size of slab position - align_up(sizeof(obj)) */ |
int (*constructor)(void *obj, int kmflag); |
int (*destructor)(void *obj); |
int flags; /**< Flags changing behaviour of cache */ |
91,7 → 91,7 |
atomic_t allocated_slabs; |
atomic_t allocated_objs; |
atomic_t cached_objs; |
atomic_t magazine_counter; /*<< How many magazines in magazines list */ |
atomic_t magazine_counter; /**< How many magazines in magazines list */ |
/* Slabs */ |
link_t full_slabs; /**< List of full slabs */ |
117,14 → 117,14 |
extern void slab_free(slab_cache_t *cache, void *obj); |
extern count_t slab_reclaim(int flags); |
/** Initialize SLAB subsytem */ |
/** Initialize slab subsytem */ |
extern void slab_cache_init(void); |
extern void slab_enable_cpucache(void); |
/* KConsole debug */ |
/* kconsole debug */ |
extern void slab_print_list(void); |
/* Malloc support */ |
/* malloc support */ |
extern void * malloc(unsigned int size, int flags); |
extern void free(void *obj); |
#endif |
/kernel/trunk/generic/src/main/kinit.c |
---|
82,6 → 82,11 |
thread_t *t; |
task_t *utask; |
/* |
* Detach kinit as nobody will call thread_join_timeout() on it. |
*/ |
thread_detach(THREAD); |
interrupts_disable(); |
#ifdef CONFIG_SMP |
98,9 → 103,11 |
t->cpu = &cpus[0]; |
spinlock_unlock(&t->lock); |
thread_ready(t); |
waitq_sleep(&kmp_completion_wq); |
} |
else panic("thread_create/kmp\n"); |
else { |
panic("thread_create/kmp\n"); |
} |
thread_join(t); |
} |
#endif /* CONFIG_SMP */ |
/* |
/kernel/trunk/generic/src/proc/scheduler.c |
---|
516,6 → 516,11 |
int count, average, i, j, k = 0; |
ipl_t ipl; |
/* |
* Detach kcpulb as nobody will call thread_join_timeout() on it. |
*/ |
thread_detach(THREAD); |
loop: |
/* |
* Work in 1s intervals. |