On Jul 12, 12:36 am, Wan-Teh Chang <[EMAIL PROTECTED]> wrote:
> Yahel Zamir wrote:
>
> > Yes, clearly PR_Shutdown was written to block until the lock is
> > available... So I would like to rephrase my question -- when an NSPR
> > socket is blocking on Read or Write,  what is the way to move the
> > socket out of that state (avoiding the workaround of using timeout for
> > that purpose), in order to close it?
>
> You should Call PR_Interrupt(), with the thread blocking on Read or
> Write as the argument.  This will cause PR_Recv or PR_Send to return
> PR_FAILURE with the error code (returned by PR_GetError())
> PR_PENDING_INTERRUPT_ERROR.
>
> Wan-Teh

OK... Since my application does not use PRThread's I guess should
obtain the PRThread id of the Read thread and the Write thread (using
PR_GetCurrentThread), and then we can interrupt each thread by calling
PR_Interrupt. As a result, both blocking calls will return an error,
and then we can close the socket.

_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to