Re: Problem interrupting threads in PR_Accept() wiht PR_Interrupt()
"Wan-Teh Chang" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.nspr |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 11, 2008 at 2:00 AM, Joachim Ziegler <[email protected]> wrote: > > Hello Wan-Teh, > > I did exactly what you proposed: Compiled my own version of nspr-4.7.1 > with having blindly (since I do not know what I am really doing) > substituted every occurrence of > > if (self->state & PT_THREAD_ABORTED) > > by > > if (_PT_THREAD_INTERRUPTED(self)) > > (This happened 4 times, in lines 459, 520, 601 and 659.) Yes, these are exactly the lines that you need to change. > Then I used the approach of issuing PR_BlockInterrupt() after > PR_Accept() and PR_UnblockInterrupt() before PR_Accept(). > > But my worker threads are still interrupted during a PR_TransmitFile(): > > [...] > [17504] Thread 4 got request: GET /www/hugefile.msi HTTP/1.1 > MASTER[17504]: Sending interrupt signal to worker threads. > MASTER[17504]: Thread 0 is blocked. Sent PR_Interrupt. > MASTER[17504]: Thread 1 is blocked. Sent PR_Interrupt. > MASTER[17504]: Thread 2 is blocked. Sent PR_Interrupt. > MASTER[17504]: Thread 3 is blocked. Sent PR_Interrupt. > MASTER[17504]: Thread 4 is blocked. Sent PR_Interrupt. > MASTER[17504]: Joining worker threads. > oops: PR_TransmitFile in do_cat: -5993: Operation interrupted by another > thread > [17504] Thread 4 is shutting down. > oops: PR_TransmitFile in do_cat: -5993: Operation interrupted by another > thread > [17504] Thread 2 is shutting down. > oops: PR_TransmitFile in do_cat: -5993: Operation interrupted by another > thread > [17504] Thread 0 is shutting down. > [...] Hi Joachim, Could you file a bug report about this problem? I'm a little busy this week. I don't want to lose track of this problem unintentionally. On what platform do you observe this problem? We have several implementations of PR_TransmitFile, so it's important to know which implementation you're using. I'm going to assume you're using Linux. You can give the following a try: in pt_linux_sendfile_cont at line 1121, add a test for EINTR similar to the test in pt_linux_sendfile_cont at line 1070. I doubt this is the problem though. Thanks, Wan-Teh