[Reconnoiter-devel] [reconnoiter commit] r1305 - trunk/src/eventer

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Tue May 25 21:20:43 EDT 2010


Author: jesus
Date: 2010-05-25 21:20:43 -0400 (Tue, 25 May 2010)
New Revision: 1305

Modified:
   trunk/src/eventer/eventer_epoll_impl.c
   trunk/src/eventer/eventer_kqueue_impl.c
   trunk/src/eventer/eventer_ports_impl.c
Log:
We don't need to know which is the 'master thread' refs #283

Modified: trunk/src/eventer/eventer_epoll_impl.c
===================================================================
--- trunk/src/eventer/eventer_epoll_impl.c	2010-05-26 01:19:45 UTC (rev 1304)
+++ trunk/src/eventer/eventer_epoll_impl.c	2010-05-26 01:20:43 UTC (rev 1305)
@@ -52,7 +52,6 @@
 
 #include "eventer/eventer_impl_private.h"
 
-static pthread_t master_thread;
 static int *masks;
 static int epoll_fd = -1;
 
@@ -63,7 +62,6 @@
   /* super init */
   if((rv = eventer_impl_init()) != 0) return rv;
 
-  master_thread = pthread_self();
   signal(SIGPIPE, SIG_IGN);
   epoll_fd = epoll_create(1024);
   if(epoll_fd == -1) {
@@ -221,13 +219,8 @@
   release_master_fd(fd, lockstate);
 }
 static int eventer_epoll_impl_loop() {
-  int is_master_thread = 0;
   struct epoll_event *epev;
-  pthread_t self;
 
-  self = pthread_self();
-  if(pthread_equal(self, master_thread)) is_master_thread = 1;
-
   epev = malloc(sizeof(*epev) * maxfds);
 
   while(1) {

Modified: trunk/src/eventer/eventer_kqueue_impl.c
===================================================================
--- trunk/src/eventer/eventer_kqueue_impl.c	2010-05-26 01:19:45 UTC (rev 1304)
+++ trunk/src/eventer/eventer_kqueue_impl.c	2010-05-26 01:20:43 UTC (rev 1305)
@@ -53,7 +53,6 @@
 #include "eventer/eventer_impl_private.h"
 
 static const struct timeval __dyna_increment = { 0, 1000 }; /* 1 ms */
-static pthread_t master_thread;
 static int kqueue_fd = -1;
 typedef struct kqueue_setup {
   struct kevent *__ke_vec;
@@ -110,7 +109,6 @@
   /* super init */
   if((rv = eventer_impl_init()) != 0) return rv;
 
-  master_thread = pthread_self();
   signal(SIGPIPE, SIG_IGN);
   kqueue_fd = kqueue();
   if(kqueue_fd == -1) {
@@ -315,15 +313,10 @@
   release_master_fd(fd, lockstate);
 }
 static int eventer_kqueue_impl_loop() {
-  int is_master_thread = 0;
   struct timeval __dyna_sleep = { 0, 0 };
-  pthread_t self;
   KQUEUE_DECL;
   KQUEUE_SETUP;
 
-  self = pthread_self();
-  if(pthread_equal(self, master_thread)) is_master_thread = 1;
-
   if(!kqs) {
     kqs = calloc(1, sizeof(*kqs));
     kqs_init(kqs);

Modified: trunk/src/eventer/eventer_ports_impl.c
===================================================================
--- trunk/src/eventer/eventer_ports_impl.c	2010-05-26 01:19:45 UTC (rev 1304)
+++ trunk/src/eventer/eventer_ports_impl.c	2010-05-26 01:20:43 UTC (rev 1305)
@@ -56,7 +56,6 @@
 #include "eventer/eventer_impl_private.h"
 
 static const struct timeval __dyna_increment = { 0, 1000 }; /* 1 ms */
-static pthread_t master_thread;
 static int port_fd = -1;
 
 static int eventer_ports_impl_init() {
@@ -66,7 +65,6 @@
   /* super init */
   if((rv = eventer_impl_init()) != 0) return rv;
 
-  master_thread = pthread_self();
   signal(SIGPIPE, SIG_IGN);
   port_fd = port_create();
   if(port_fd == -1) {
@@ -243,12 +241,7 @@
 }
 static int eventer_ports_impl_loop() {
   struct timeval __dyna_sleep = { 0, 0 };
-  int is_master_thread = 0;
-  pthread_t self;
 
-  self = pthread_self();
-  if(pthread_equal(self, master_thread)) is_master_thread = 1;
-
   while(1) {
     const char *cbname;
     struct timeval __now, __sleeptime;



More information about the Reconnoiter-devel mailing list