harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Aliev" <artem.al...@gmail.com>
Subject Re: [drlvm] problem when TM patch applied
Date Wed, 23 Aug 2006 08:52:40 GMT
Gier,

The DRLVM uses SIGUSR2 in thread suspend algorithm.
hysock_select() returns EINTR error when the signal appears, and
Socket.accept() throws exception.

The New ThreadManager use thread_suspend() more extensively ( in lock
reservation algorithm). So the problem appears more frequently.

Following patch to hysock.c fixes the problem in hysock.
Probably classlib experts could provide better way to fix this problem.

--
Artem Aliev, Intel Middleware Products Division

--- modules/luni/src/main/native/port/linux/hysock.c
+++ modules/luni/src/main/native/port/linux/hysock.c
@@ -2570,11 +2570,16 @@ hysock_select (struct HyPortLibrary * po
   I_32 rc = 0;
   I_32 result = 0;

-  result =
+  do
+  {
+    result =
     select (nfds, readfds == NULL ? NULL : &readfds->handle,
             writefds == NULL ? NULL : &writefds->handle,
             exceptfds == NULL ? NULL : &exceptfds->handle,
             timeout == NULL ? NULL : &timeout->time);
+  }
+  while (result == -1 && errno == EINTR);
+
   if (result == -1)
     {
       rc = errno;

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message