Threads signalling issue [was RE: threads change]

[email protected] ("Jerry D. Hedden")
Newsgroups perl.perl5.porters,perl.ithreads
Message-ID <20060714104517.fb30e530d17747c2b054d625b8945d88.854abdc93a.wbe@email.secureserver.net>
>         /* Set the signal for the thread */
>         thread = SV_to_ithread(aTHX_ ST(0));
>         MUTEX_LOCK(&thread->mutex);
>         if (thread->interp) {
>             dTHXa(thread->interp);
>             PL_psig_pend[signal]++;
>             PL_sig_pending = 1;
>         }
>         MUTEX_UNLOCK(&thread->mutex);

Artur Bergman wrote:
> Please humour me and explain to me how that lock is 
> going to protect thread->interp? thread->interp is
> currently running.

The locks protect against thread->interp being freed
while the block is executing.

If you mean that PL_psig_pend[signal], etc. should be
locked:

         /* Set the signal for the thread */
         thread = SV_to_ithread(aTHX_ ST(0));
         MUTEX_LOCK(&thread->mutex);
         if (thread->interp) {
             dTHXa(thread->interp);

             /*** SET A "SIGNAL" LOCK HERE ***/
             PL_psig_pend[signal]++;
             PL_sig_pending = 1;
             /*** UNLOCK HERE ***/

         }
         MUTEX_UNLOCK(&thread->mutex);

then what should the fix be?  Anyone?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.