lkml.org 
[lkml]   [2000]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] pcmcia event thread. (fwd)
    Date

    jgarzik@mandrakesoft.com 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.


    jgarzik@mandrakesoft.com 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.



    --
    dwmw2


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/

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