[lkml]   [2000]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] pcmcia event thread. (fwd)
    Date said:
    > Doh, totally forgot about that. Will this work:
    > save_current = current;
    > current = find_task_by_pid(1);
    > waitpid(...);
    > current = save_current;

    Changing the thread's parent to current->pid would be better than modifying
    current. Still sucks though....

    > In any case, we -really- need a wait_for_kernel_thread_to_die()
    > function.

    up_and_exit() would do it. Or preferably passing the address of the
    semaphore as an extra argument to kernel_thread() in the first place.

    In the meantime, enough other places in the kernel have this same race that
    I'm not too concerned about it. Hopefully, we'll get the extra arg to
    kernel_thread before the final cut of 2.4, and this code can get converted
    along with everything else.

    > > + spin_lock_irq(&current->sigmask_lock);
    > > + sigfillset(&current->blocked);
    > > + recalc_sigpending(current);
    > > + spin_unlock_irq(&current->sigmask_lock);

    > what does this do?

    Well, I _hope_ it blocks all signals, so that we can sleep in
    TASK_INTERRUPTIBLE without adding 1 to the load average, and without having
    to worry about the pesky things actually interrupting us. said:
    > why do you store the event_thread_pid but never use it?

    Because I got half way through doing waitpid() before I realised it was
    sucky. We store it short-term so we can print it. No reason why we can't
    shift the static declaration into init_pcmcia_cs() though.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:45    [W:0.030 / U:35.784 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site