Skip to content

Commit

Permalink
Provide OpenSSL style support for multiple threads accessing the same…
Browse files Browse the repository at this point in the history
… event_base

svn:r684
  • Loading branch information
provos committed Mar 2, 2008
1 parent 19dad16 commit 558de9b
Show file tree
Hide file tree
Showing 14 changed files with 754 additions and 36 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -56,6 +56,7 @@ Changes in current version:
o rewrite of the evbuffer code to reduce memory copies
o Some older Solaris versions demand that _REENTRANT be defined to get strtok_r(); do so.
o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
o Provide OpenSSL style support for multiple threads accessing the same event_base

Changes in 1.4.0:
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -29,7 +29,7 @@ VERSION_INFO = 2:0:0
bin_SCRIPTS = event_rpcgen.py

EXTRA_DIST = autogen.sh event.h event-internal.h log.h evsignal.h evdns.3 \
evrpc.h evrpc-internal.h min_heap.h \
evrpc.h evrpc-internal.h min_heap.h evthread-internal.h \
event.3 \
kqueue.c epoll_sub.c epoll.c select.c poll.c signal.c \
evport.c devpoll.c event_rpcgen.py \
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Expand Up @@ -4,7 +4,7 @@ SYSNAME=`uname`
if [ "x$SYSNAME" = "xDarwin" ] ; then
LIBTOOLIZE=glibtoolize
fi
aclocal && \
aclocal -I m4 && \
autoheader && \
$LIBTOOLIZE && \
autoconf && \
Expand Down
18 changes: 17 additions & 1 deletion configure.in
Expand Up @@ -22,7 +22,9 @@ fi

AC_ARG_ENABLE(gcc-warnings,
AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings with GCC))

AC_ARG_ENABLE(thread-support,
AS_HELP_STRING(--enable-thread-support, enable support for threading),
[], [enable_thread_support=yes])
AC_PROG_LIBTOOL

dnl Uncomment "AC_DISABLE_SHARED" to make shared librraries not get
Expand Down Expand Up @@ -351,6 +353,20 @@ AC_TRY_COMPILE([],
[Define to appropriate substitue if compiler doesnt have __func__])))


# check if we can compile with pthreads for the unittests
have_pthreads=no
ACX_PTHREAD([
AC_DEFINE(HAVE_PTHREADS, 1,
[Define if we have pthreads on this system])
have_pthreads=yes])
AM_CONDITIONAL(PTHREAD_REGRESS, [test "$have_pthreads" != "no"])

# check if we should compile locking into the library
if test x$enable_thread_support = xno; then
AC_DEFINE(DISABLE_THREAD_SUPPORT, 1,
[Define if libevent should not be compiled with thread support])
fi

# Add some more warnings which we use in development but not in the
# released versions. (Some relevant gcc versions can't handle these.)
if test x$enable_gcc_warnings = xyes; then
Expand Down
7 changes: 7 additions & 0 deletions event-internal.h
Expand Up @@ -67,6 +67,13 @@ struct event_base {
struct timeval event_tv;

struct min_heap timeheap;

/* threading support */
unsigned long th_owner_id;
unsigned long (*th_get_id)(void);
void (*th_lock)(int mode, int locknum);
int th_notify_fd[2];
struct event th_notify;
};

/* Internal use only: Functions that might be missing from <sys/queue.h> */
Expand Down

0 comments on commit 558de9b

Please sign in to comment.