[lcm] 7 new revisions pushed by ashu...@gmail.com on 2014-11-12 04:12 GMT

6 views
Skip to first unread message

l...@googlecode.com

unread,
Nov 11, 2014, 11:12:27 PM11/11/14
to lcm...@googlegroups.com
master moved from 63da3a9c3ce3 to d45b3417719b

7 new revisions:

Revision: 12a794913314
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 06:57:16 2014 UTC
Log: use select() instead of poll() in lcm_mpdupm.c
https://code.google.com/p/lcm/source/detail?r=12a794913314

Revision: bdceae843e8e
Author: Albert Huang <ash...@gmail.com>
Date: Wed Nov 12 04:01:51 2014 UTC
Log: mpudpm unlock mutex before calling select()
https://code.google.com/p/lcm/source/detail?r=bdceae843e8e

Revision: 41e9f54ebb82
Author: ashuang <ash...@gmail.com>
Date: Wed Nov 12 04:06:38 2014 UTC
Log: Merge pull request #5 from lcm-proj/nopoll...
https://code.google.com/p/lcm/source/detail?r=41e9f54ebb82

Revision: 5e5b375ca513
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 07:50:40 2014 UTC
Log: cleanup configure.ac java sections
https://code.google.com/p/lcm/source/detail?r=5e5b375ca513

Revision: 43fa7ad2fbe0
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:03:17 2014 UTC
Log: clean up automake warnings
https://code.google.com/p/lcm/source/detail?r=43fa7ad2fbe0

Revision: 3d661cba34f5
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:13:01 2014 UTC
Log: remove gettext, iconv, i18n
https://code.google.com/p/lcm/source/detail?r=3d661cba34f5

Revision: d45b3417719b
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:18:16 2014 UTC
Log: remove --without-examples (examples don't get built anymore)
https://code.google.com/p/lcm/source/detail?r=d45b3417719b

==============================================================================
Revision: 12a794913314
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 06:57:16 2014 UTC
Log: use select() instead of poll() in lcm_mpdupm.c

https://code.google.com/p/lcm/source/detail?r=12a794913314

Modified:
/lcm/lcm_mpudpm.c

=======================================
--- /lcm/lcm_mpudpm.c Mon Jul 7 07:47:57 2014 UTC
+++ /lcm/lcm_mpudpm.c Sat Nov 8 06:57:16 2014 UTC
@@ -14,7 +14,6 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
-#include <sys/poll.h>
#include <sys/select.h>
#endif

@@ -28,14 +27,6 @@

#include "lcmtypes/channel_port_map_update_t.h"

-#ifdef WIN32
-// Windows provides Poll, but calls it WSAPoll
-typedef int nfds_t;
-static inline int poll(struct pollfd fds[], nfds_t nfds, int timeout) {
- return WSAPoll(fds, nfds, timeout);
-}
-#endif
-
// Lets reserve channels starting with #! for internal use
#define RESERVED_CHANNEL_PREFIX "#!"
// The number of LCM channels that we use internally for stuff.
@@ -127,10 +118,6 @@
* accessed. must be protected by the receive_lock.*/
int8_t recv_sockets_changed;

- /* datastructure used for calls to poll()*/
- int num_recv_socket_pollers;
- struct pollfd * recv_socket_pollers;
-
/* list of mpudpm_subscriber_t structs */
GSList* subscribers;

@@ -215,8 +202,6 @@
static void update_subscription_ports(lcm_mpudpm_t* lcm);
static void add_channel_to_subscriber(lcm_mpudpm_t* lcm,
mpudpm_subscriber_t * sub, const char * channel, uint16_t port);
-static void cleanup_pollers(lcm_mpudpm_t * lcm);
-


static GStaticPrivate CREATE_READ_THREAD_PKEY = G_STATIC_PRIVATE_INIT;
@@ -274,8 +259,6 @@
}
g_slist_free(lcm->subscribers);
}
-
- cleanup_pollers(lcm);

if (lcm->frag_bufs) {
lcm_frag_buf_store_destroy(lcm->frag_bufs);
@@ -581,30 +564,6 @@
lcmb->data_size = sz - lcmb->data_offset;
return 1;
}
-
-static void cleanup_pollers(lcm_mpudpm_t * lcm) {
- if (lcm->recv_socket_pollers != NULL ) {
- free(lcm->recv_socket_pollers);
- }
-}
-
-// this function assums that the caller is holding the receive_lock
-static void setup_pollers(lcm_mpudpm_t * lcm) {
- //+1 for thread_msg_pipe
- lcm->num_recv_socket_pollers = g_slist_length(lcm->recv_sockets) + 1;
- lcm->recv_socket_pollers = (struct pollfd *) calloc(
- lcm->num_recv_socket_pollers, sizeof(struct pollfd));
- lcm->recv_socket_pollers[0].fd = lcm->thread_msg_pipe[0];
- lcm->recv_socket_pollers[0].events = POLLIN;
-
- int poll_i = 1;
- for (GSList* it = lcm->recv_sockets; it != NULL ; it = it->next,
++poll_i) {
- mpudpm_socket_t * sub_socket = (mpudpm_socket_t *) it->data;
- lcm->recv_socket_pollers[poll_i].fd = sub_socket->fd;
- lcm->recv_socket_pollers[poll_i].events = POLLIN;
- }
- lcm->recv_sockets_changed = 0; // mark things as clean
-}

// this function will aquire locks if needed
static void dispatch_complete_message(lcm_mpudpm_t * lcm, lcm_buf_t * lcmb,
@@ -684,20 +643,34 @@

// lock subscription lists so things don't change on us
g_static_mutex_lock(&lcm->receive_lock);
- if (lcm->recv_sockets_changed || lcm->recv_socket_pollers == NULL
) {
- cleanup_pollers(lcm);
- setup_pollers(lcm);
+
+ // setup file descriptors for select
+ fd_set fds;
+ FD_ZERO(&fds);
+
+ // thread_msg_pipe fd
+ FD_SET(lcm->thread_msg_pipe[0], &fds);
+ SOCKET maxfd = lcm->thread_msg_pipe[0];
+
+ for (GSList* it = lcm->recv_sockets; it != NULL ; it = it->next) {
+ mpudpm_socket_t * sub_socket = (mpudpm_socket_t *) it->data;
+ FD_SET(sub_socket->fd, &fds);
+ if (sub_socket->fd > maxfd) {
+ maxfd = sub_socket->fd;
+ }
+ }
+
+ if (select(maxfd + 1, &fds, NULL, NULL, NULL) < 0) {
+ perror("udp_read_packet -- select() failed:");
+ continue;
}
+ lcm->recv_sockets_changed = 0;
+
// unlock receive_lock while we wait for a message
g_static_mutex_unlock(&lcm->receive_lock);
- if (poll(lcm->recv_socket_pollers, lcm->num_recv_socket_pollers,
-1)
- <= 0) {
- perror("udp_read_packet -- poll() failed:");
- continue;
- }

// check for a signaling message
- if (lcm->recv_socket_pollers[0].revents) {
+ if (FD_ISSET(lcm->thread_msg_pipe[0], &fds)) {
char ch;
int status = lcm_internal_pipe_read(lcm->thread_msg_pipe[0],
&ch,
1);
@@ -742,10 +715,9 @@
it = it->next, ++poll_i) {
// We should be holding receive_lock at the start of this loop
mpudpm_socket_t * sub_socket = (mpudpm_socket_t *) it->data;
- if (!lcm->recv_socket_pollers[poll_i].revents) {
+ if (!FD_ISSET(sub_socket->fd, &fds)) {
continue;
} else {
- assert(sub_socket->fd ==
lcm->recv_socket_pollers[poll_i].fd);
recv_fd = sub_socket->fd;
recv_port = sub_socket->port;
}

==============================================================================
Revision: bdceae843e8e
Author: Albert Huang <ash...@gmail.com>
Date: Wed Nov 12 04:01:51 2014 UTC
Log: mpudpm unlock mutex before calling select()

https://code.google.com/p/lcm/source/detail?r=bdceae843e8e

Modified:
/lcm/lcm_mpudpm.c

=======================================
--- /lcm/lcm_mpudpm.c Sat Nov 8 06:57:16 2014 UTC
+++ /lcm/lcm_mpudpm.c Wed Nov 12 04:01:51 2014 UTC
@@ -659,15 +659,15 @@
maxfd = sub_socket->fd;
}
}
+ lcm->recv_sockets_changed = 0;
+
+ // unlock receive_lock while we wait for a message
+ g_static_mutex_unlock(&lcm->receive_lock);

if (select(maxfd + 1, &fds, NULL, NULL, NULL) < 0) {
perror("udp_read_packet -- select() failed:");
continue;
}
- lcm->recv_sockets_changed = 0;
-
- // unlock receive_lock while we wait for a message
- g_static_mutex_unlock(&lcm->receive_lock);

// check for a signaling message
if (FD_ISSET(lcm->thread_msg_pipe[0], &fds)) {

==============================================================================
Revision: 41e9f54ebb82
Author: ashuang <ash...@gmail.com>
Date: Wed Nov 12 04:06:38 2014 UTC
Log: Merge pull request #5 from lcm-proj/nopoll

use select() instead of poll() in lcm_mpdupm.c
https://code.google.com/p/lcm/source/detail?r=41e9f54ebb82



==============================================================================
Revision: 5e5b375ca513
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 07:50:40 2014 UTC
Log: cleanup configure.ac java sections

https://code.google.com/p/lcm/source/detail?r=5e5b375ca513

Modified:
/configure.ac

=======================================
--- /configure.ac Sun Oct 19 22:56:07 2014 UTC
+++ /configure.ac Sat Nov 8 07:50:40 2014 UTC
@@ -70,19 +70,17 @@
[], [with_java=yes])
if test "x$with_java" = xno -o "x$JAR" = x -o "x$JAVAC" = x; then
AC_MSG_WARN([Java support disabled])
+ with_java="no"
else
- AC_CHECK_PROG(HAVE_ANT, ant, true, false)
- AM_CONDITIONAL(HAVE_ANT,$HAVE_ANT)
- if test $HAVE_ANT = "false"; then
- AC_MSG_WARN([*** ant not found, java will not be built])
- else
- JAVA_FOUND="yes"
- fi
+ AC_CHECK_PROG(HAVE_ANT, ant, true, false)
+ ANT_STR=""
+ if test $HAVE_ANT = "false"; then
+ with_java="no"
+ ANT_STR="(ant not found)"
+ fi
fi

-
-
-AM_CONDITIONAL(HAVE_JAVA, test "x$JAVA_FOUND" = "xyes")
+AM_CONDITIONAL(HAVE_JAVA, test "x$with_java" = "xyes")
java_apiversion="1.0"
AC_ARG_WITH(jardir,
[AS_HELP_STRING([--with-jardir=DIR],
@@ -166,7 +164,7 @@
m4macros/Makefile
])

-if test "x$JAVA_FOUND" = "xyes"; then
+if test "x$with_java" = "xyes"; then
JAVA_STR="Enabled"
else
JAVA_STR="Disabled"
@@ -187,16 +185,11 @@
echo "
"

-if test $HAVE_ANT = "false"; then
- AC_MSG_WARN([*** ant not found, java will not be built
-])
-fi
-
echo "Configuration (LCM v${PACKAGE_VERSION}):

Source code location: ${srcdir}
Compiler: ${CC}
- Java Support: ${JAVA_STR}
+ Java Support: ${JAVA_STR} ${ANT_STR}
Python Support: ${PYTHON_STR}
Lua Support: ${LUA_STR}
"

==============================================================================
Revision: 43fa7ad2fbe0
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:03:17 2014 UTC
Log: clean up automake warnings

https://code.google.com/p/lcm/source/detail?r=43fa7ad2fbe0

Modified:
/lcm-logger/Makefile.am
/lcm-python/Makefile.am
/lcm/Makefile.am
/lcmgen/Makefile.am
/liblcm-test/Makefile.am

=======================================
--- /lcm-logger/Makefile.am Wed Jan 6 21:01:54 2010 UTC
+++ /lcm-logger/Makefile.am Sat Nov 8 08:03:17 2014 UTC
@@ -1,4 +1,4 @@
-INCLUDES = -I$(top_srcdir) $(GLIB_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)

bin_PROGRAMS = lcm-logger lcm-logplayer

=======================================
--- /lcm-python/Makefile.am Thu Mar 25 21:39:24 2010 UTC
+++ /lcm-python/Makefile.am Sat Nov 8 08:03:17 2014 UTC
@@ -1,4 +1,4 @@
-INCLUDES = $(PYTHON_INCLUDES)
+AM_CPPFLAGS = $(PYTHON_INCLUDES)
pylcmexec_PYTHON = \
lcm/__init__.py

=======================================
--- /lcm/Makefile.am Sat Jun 28 06:00:00 2014 UTC
+++ /lcm/Makefile.am Sat Nov 8 08:03:17 2014 UTC
@@ -1,4 +1,6 @@
-INCLUDES = $(GLIB_CFLAGS)
+AUTOMAKE_OPTIONS=subdir-objects
+
+AM_CPPFLAGS = $(GLIB_CFLAGS)

lib_LTLIBRARIES = liblcm.la

=======================================
--- /lcmgen/Makefile.am Wed Feb 19 02:45:55 2014 UTC
+++ /lcmgen/Makefile.am Sat Nov 8 08:03:17 2014 UTC
@@ -1,4 +1,4 @@
-INCLUDES = $(GLIB_CFLAGS)
+AM_CPPFLAGS = $(GLIB_CFLAGS)

bin_PROGRAMS = lcm-gen

=======================================
--- /liblcm-test/Makefile.am Tue Mar 8 04:38:58 2011 UTC
+++ /liblcm-test/Makefile.am Sat Nov 8 08:03:17 2014 UTC
@@ -1,4 +1,4 @@
-INCLUDES = -I$(top_srcdir) $(GLIB_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)

noinst_PROGRAMS = lcm-sink \
lcm-source \

==============================================================================
Revision: 3d661cba34f5
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:13:01 2014 UTC
Log: remove gettext, iconv, i18n

https://code.google.com/p/lcm/source/detail?r=3d661cba34f5

Deleted:
/po/Makevars
/po/POTFILES.in
Modified:
/.gitignore
/Makefile.am
/configure.ac
/docs/content/build-instructions.md

=======================================
--- /po/Makevars Mon Dec 17 23:05:30 2007 UTC
+++ /dev/null
@@ -1,41 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
-# package. (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.) Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright. The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Albert Huang, David Moore, Edwin Olson
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-# in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-# understood.
-# - Strings which make invalid assumptions about notation of date, time or
-# money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS = d...@acm.org
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used. It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
=======================================
--- /.gitignore Mon Oct 20 19:14:00 2014 UTC
+++ /.gitignore Sat Nov 8 08:13:01 2014 UTC
@@ -49,6 +49,7 @@
lcm/Makefile
lcm/Makefile.in
lcm/lcm.pc
+lcm/lcmtypes/.dirstamp

lcmgen/Makefile
lcmgen/Makefile.in
@@ -68,7 +69,6 @@
m4/Makefile
m4/Makefile.in
m4/codeset.m4
-m4/gettext.m4
m4/glibc2.m4
m4/glibc21.m4
m4/iconv.m4
@@ -105,19 +105,6 @@
m4macros/Makefile.in
missing
mkinstalldirs
-po/Makefile
-po/Makefile.in
-po/Makefile.in.in
-po/Makevars.template
-po/POTFILES
-po/Rules-quot
-po/boldquot.sed
-po/e...@boldquot.header
-po/e...@quot.header
-po/insert-header.sin
-po/quot.sed
-po/remove-potcdate.sed
-po/remove-potcdate.sin
py-compile
test/.buildstamp
test/c/client
=======================================
--- /Makefile.am Tue Feb 19 04:03:18 2013 UTC
+++ /Makefile.am Sat Nov 8 08:13:01 2014 UTC
@@ -1,4 +1,4 @@
-SUBDIRS = m4 lcm liblcm-test lcmgen lcm-logger po m4macros
+SUBDIRS = m4 lcm liblcm-test lcmgen lcm-logger m4macros

if HAVE_JAVA
SUBDIRS += lcm-java
=======================================
--- /configure.ac Sat Nov 8 07:50:40 2014 UTC
+++ /configure.ac Sat Nov 8 08:13:01 2014 UTC
@@ -125,20 +125,6 @@
[], [with_examples=yes])
AM_CONDITIONAL(WITH_EXAMPLES,[test "x$with_examples" = xyes])

-dnl
---------------------------------------------------------------------------
-dnl i18n support
-dnl
---------------------------------------------------------------------------
-ALL_LINGUAS=""
-
-dnl The gettext domain of the library
-GETTEXT_PACKAGE=${PACKAGE}
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The gettext domain
for the library])
-AC_SUBST(GETTEXT_PACKAGE)
-AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION(0.14.3)
-
-AM_ICONV()
-
dnl
---------------------------------------------------------------------------
dnl Warnings
dnl
---------------------------------------------------------------------------
@@ -160,7 +146,6 @@
lcm-lua/Makefile
examples/Makefile
m4/Makefile
- po/Makefile.in
m4macros/Makefile
])

=======================================
--- /docs/content/build-instructions.md Sat Oct 25 04:49:03 2014 UTC
+++ /docs/content/build-instructions.md Sat Nov 8 08:13:01 2014 UTC
@@ -85,7 +85,6 @@
- automake
- autopoint
- libglib2.0-dev
- - gettext
- libtool

Strongly recommended packages:

==============================================================================
Revision: d45b3417719b
Author: Albert Huang <ash...@gmail.com>
Date: Sat Nov 8 08:18:16 2014 UTC
Log: remove --without-examples (examples don't get built anymore)

https://code.google.com/p/lcm/source/detail?r=d45b3417719b

Modified:
/Makefile.am
/configure.ac

=======================================
--- /Makefile.am Sat Nov 8 08:13:01 2014 UTC
+++ /Makefile.am Sat Nov 8 08:18:16 2014 UTC
@@ -1,4 +1,4 @@
-SUBDIRS = m4 lcm liblcm-test lcmgen lcm-logger m4macros
+SUBDIRS = m4 lcm liblcm-test lcmgen lcm-logger m4macros examples

if HAVE_JAVA
SUBDIRS += lcm-java
@@ -12,9 +12,5 @@
SUBDIRS += lcm-lua
endif

-if WITH_EXAMPLES
-SUBDIRS += examples
-endif
-
EXTRA_DIST = WinSpecific lcm-dotnet lcm-lite docs test
ACLOCAL_AMFLAGS = -I m4
=======================================
--- /configure.ac Sat Nov 8 08:13:01 2014 UTC
+++ /configure.ac Sat Nov 8 08:18:16 2014 UTC
@@ -117,14 +117,6 @@

AM_CONDITIONAL(HAVE_LUA, test "x$with_lua" = "xyes")

-dnl -------------------------------------------------
-dnl Maybe the user doesn't want to build the examples
-dnl -------------------------------------------------
-AC_ARG_WITH(examples,
- [AS_HELP_STRING([--without-examples], [Do not compile
examples])],
- [], [with_examples=yes])
-AM_CONDITIONAL(WITH_EXAMPLES,[test "x$with_examples" = xyes])
-
dnl
---------------------------------------------------------------------------
dnl Warnings
dnl
---------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages