Changeset 2cb5e64 in mainline


Ignore:
Timestamp:
2006-06-04T19:47:36Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7509ddc
Parents:
c4e4507
Message:

Make use of thread_join_timeout() and thread_detach() in kernel.

Improved comments in slab.h.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/include/smp/mps.h

    rc4e4507 r2cb5e64  
    117117
    118118extern waitq_t ap_completion_wq;
    119 extern waitq_t kmp_completion_wq;
    120119
    121120extern struct smp_config_operations mps_config_operations;
  • arch/ia32/src/smp/mps.c

    rc4e4507 r2cb5e64  
    8080
    8181waitq_t ap_completion_wq;
    82 waitq_t kmp_completion_wq;
    83 
    8482
    8583/*
  • arch/ia32/src/smp/smp.c

    rc4e4507 r2cb5e64  
    8585                io_apic = (__u32 *) io_apic_address;
    8686        }
    87 
    88         /*
    89          * Must be initialized outside the kmp thread, since it is waited
    90          * on before the kmp thread is created.
    91          */
    92         waitq_initialize(&kmp_completion_wq);
    93 
    9487}
    9588
     
    173166                        printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
    174167        }
    175 
    176         /*
    177          * Wakeup the kinit thread so that
    178          * system initialization can go on.
    179          */
    180         waitq_wakeup(&kmp_completion_wq, WAKEUP_FIRST);
    181168}
    182169
  • generic/include/mm/slab.h

    rc4e4507 r2cb5e64  
    7979        link_t link;
    8080        /* Configuration */
    81         size_t size;      /**< Size of SLAB position - align_up(sizeof(obj)) */
     81        size_t size;      /**< Size of slab position - align_up(sizeof(obj)) */
    8282        int (*constructor)(void *obj, int kmflag);
    8383        int (*destructor)(void *obj);
     
    9292        atomic_t allocated_objs;
    9393        atomic_t cached_objs;
    94         atomic_t magazine_counter; /*<< How many magazines in magazines list */
     94        atomic_t magazine_counter; /**< How many magazines in magazines list */
    9595
    9696        /* Slabs */
     
    118118extern count_t slab_reclaim(int flags);
    119119
    120 /** Initialize SLAB subsytem */
     120/** Initialize slab subsytem */
    121121extern void slab_cache_init(void);
    122122extern void slab_enable_cpucache(void);
    123123
    124 /* KConsole debug */
     124/* kconsole debug */
    125125extern void slab_print_list(void);
    126126
    127 /* Malloc support */
     127/* malloc support */
    128128extern void * malloc(unsigned int size, int flags);
    129129extern void free(void *obj);
  • generic/include/proc/thread.h

    rc4e4507 r2cb5e64  
    3838#include <time/timeout.h>
    3939#include <synch/rwlock.h>
     40#include <synch/synch.h>
    4041#include <config.h>
    4142#include <adt/btree.h>
     
    155156extern void thread_usleep(__u32 usec);
    156157
     158#define thread_join(t)  thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
    157159extern int thread_join_timeout(thread_t *t, __u32 usec, int flags);
    158160extern void thread_detach(thread_t *t);
  • generic/src/main/kinit.c

    rc4e4507 r2cb5e64  
    8383        task_t *utask;
    8484
     85        /*
     86         * Detach kinit as nobody will call thread_join_timeout() on it.
     87         */
     88        thread_detach(THREAD);
     89
    8590        interrupts_disable();
    8691
     
    99104                        spinlock_unlock(&t->lock);
    100105                        thread_ready(t);
    101                         waitq_sleep(&kmp_completion_wq);
    102106                }
    103                 else panic("thread_create/kmp\n");
     107                else {
     108                        panic("thread_create/kmp\n");
     109                }
     110                thread_join(t);
    104111        }
    105112#endif /* CONFIG_SMP */
  • generic/src/proc/scheduler.c

    rc4e4507 r2cb5e64  
    517517        ipl_t ipl;
    518518
     519        /*
     520         * Detach kcpulb as nobody will call thread_join_timeout() on it.
     521         */
     522        thread_detach(THREAD);
     523       
    519524loop:
    520525        /*
Note: See TracChangeset for help on using the changeset viewer.