Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Merge branch 'v1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Nov 20, 2014
2 parents 89bc098 + 1560691 commit 52ae456
Show file tree
Hide file tree
Showing 26 changed files with 206 additions and 291 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ vgcore.*
Makefile
Makefile.in

# Generated by dtrace(1) when doing an in-tree build.
/include/uv-dtrace.h

# Generated by gyp for android
*.target.mk

Expand Down
6 changes: 1 addition & 5 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ Leonard Hecker <leonard.hecker91@gmail.com> <leonard@hecker.io>
Maciej Małecki <maciej.malecki@notimplemented.org> <me@mmalecki.com>
Marc Schlaich <marc.schlaich@googlemail.com> <marc.schlaich@gmail.com>
Rasmus Christian Pedersen <ruysch@outlook.com>
Rasmus Christian Pedersen <ruysch@outlook.com>
Rasmus Christian Pedersen <ruysch@outlook.com>
Rasmus Christian Pedersen <ruysch@outlook.com>
Rasmus Christian Pedersen <ruysch@outlook.com>
Rasmus Christian Pedersen <zerhacken@yahoo.com> <ruysch@outlook.com>
Rasmus Christian Pedersen <zerhacken@yahoo.com>
Rasmus Pedersen <ruysch@outlook.com> <zerhacken@yahoo.com>
Robert Mustacchi <rm@joyent.com> <rm@fingolfin.org>
Ryan Dahl <ryan@joyent.com> <ry@tinyclouds.org>
Expand Down
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,8 @@ Jeff Widman <jeff@jeffwidman.com>
cjihrig <cjihrig@gmail.com>
Tomasz Kołodziejski <tkolodziejski@mozilla.com>
Unknown W. Brackets <checkins@unknownbrackets.org>
Emmanuel Odeke <odeke@ualberta.ca>
Mikhail Mukovnikov <yndi@me.com>
Thorsten Lorenz <thlorenz@gmx.de>
Yuri D'Elia <yuri.delia@eurac.edu>
Manos Nikolaidis <manos@shadowrobot.com>
32 changes: 32 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
2014.11.21, Version 1.0.0 (Stable)

Changes since version 1.0.0-rc2:

* doc: fix git/svn url for gyp repo in README (Emmanuel Odeke)

* windows: fix fs_read with nbufs > 1 and offset (Unknown W. Brackets)

* win: add missing IP_ADAPTER_UNICAST_ADDRESS_LH definition for MinGW
(huxingyi)

* doc: mention homebrew in README (Mikhail Mukovnikov)

* doc: add learnuv workshop to README (Thorsten Lorenz)

* doc: fix parameter name in uv_fs_access (Saúl Ibarra Corretgé)

* unix: use cfmakeraw() for setting raw TTY mode (Yuri D'Elia)

* win: fix uv_thread_self() (Alexis Campailla)

* build: add x32 support to gyp build (Ben Noordhuis)

* build: remove dtrace probes (Ben Noordhuis)

* doc: fix link in misc.rst (Manos Nikolaidis)

* mailmap: remove duplicated entries (Saúl Ibarra Corretgé)

* gyp: fix comment regarding version info location (Saúl Ibarra Corretgé)


2014.10.21, Version 1.0.0-rc2 (Pre-release)

Changes since version 1.0.0-rc1:
Expand Down
39 changes: 0 additions & 39 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -307,46 +307,7 @@ libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
libuv_la_SOURCES += src/unix/sunos.c
endif

if HAVE_DTRACE
BUILT_SOURCES = include/uv-dtrace.h
CLEANFILES += include/uv-dtrace.h
if FREEBSD
libuv_la_LDFLAGS += -lelf
endif
endif

if DTRACE_NEEDS_OBJECTS
libuv_la_SOURCES += src/unix/uv-dtrace.d
libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
libuv_la_LIBADD = uv-dtrace.lo
CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
endif

if HAVE_PKG_CONFIG
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = @PACKAGE_NAME@.pc
endif

if HAVE_DTRACE
include/uv-dtrace.h: src/unix/uv-dtrace.d
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
endif

if DTRACE_NEEDS_OBJECTS
SUFFIXES = .d

src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}

# It's ok to specify the output here, because we have 1 .d file, and we process
# every created .o, most projects don't need to include more than one .d
.d.o:
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
`find ${top_builddir}/src -name "*.o"`
$(AM_V_GEN)printf %s\\n \
'# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# libtool wants a .lo not a .o' \
"pic_object='uv-dtrace.o'" \
"non_pic_object='uv-dtrace.o'" \
> ${top_builddir}/uv-dtrace.lo
endif
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Documentation can be browsed online [here](http://docs.libuv.org).
&mdash; API specification and usage examples.
* [libuv-dox](https://github.com/thlorenz/libuv-dox)
&mdash; Documenting types and methods of libuv, mostly by reading uv.h.
* [learnuv](https://github.com/thlorenz/learnuv)
&mdash; Learn uv for fun and profit, a self guided workshop to libuv.

## Build Instructions

Expand Down Expand Up @@ -109,8 +111,9 @@ generate uv.sln as well as related project files.
To have GYP generate build script for another system, checkout GYP into the
project tree manually:

$ mkdir -p build
$ git clone https://git.chromium.org/external/gyp.git build/gyp
$ git clone https://chromium.googlesource.com/external/gyp.git build/gyp
OR
$ svn co http://gyp.googlecode.com/svn/trunk build/gyp

### Unix

Expand All @@ -119,6 +122,8 @@ Run:
$ ./gyp_uv.py -f make
$ make -C out

Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries.

### OS X

Run:
Expand All @@ -127,6 +132,10 @@ Run:
$ xcodebuild -ARCHS="x86_64" -project uv.xcodeproj \
-configuration Release -target All

Using Homebrew:

$ brew install --HEAD libuv

Note to OS X users:

Make sure that you specify the architecture you wish to build for in the
Expand Down
4 changes: 4 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.0.0-rc3], [https://github.com/joyent/libuv/issues])
AC_INIT([libuv], [1.0.0], [https://github.com/joyent/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand Down Expand Up @@ -50,7 +50,6 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
PANDORA_ENABLE_DTRACE
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
AS_IF([test "x$PKG_CONFIG" != "x"], [
Expand Down
2 changes: 1 addition & 1 deletion docs/src/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ API
Limited equivalent to ``sendfile(2)``.
.. c:function:: int uv_fs_access(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb)
.. c:function:: int uv_fs_access(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb)
Equivalent to ``access(2)`` on Unix. Windows uses ``GetFileAttributesW()``.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ API
.. c:function:: void uv_loadavg(double avg[3])
Gets the load average. See: http://en.wikipedia.org/wiki/Load_(computing)
Gets the load average. See: `<http://en.wikipedia.org/wiki/Load_(computing)>`_
.. note::
Returns [0,0,0] on Windows (i.e., it's not implemented).
Expand Down
2 changes: 1 addition & 1 deletion docs/src/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Threads
^^^^^^^

.. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg)
.. c:function:: unsigned long uv_thread_self(void)
.. c:function:: uv_thread_t uv_thread_self(void)
.. c:function:: int uv_thread_join(uv_thread_t *tid)
.. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2)
Expand Down
4 changes: 2 additions & 2 deletions include/uv-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 0
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 0
#define UV_VERSION_SUFFIX "rc3"
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

#endif /* UV_VERSION_H */
2 changes: 1 addition & 1 deletion include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop,
UV_EXTERN int uv_fs_access(uv_loop_t* loop,
uv_fs_t* req,
const char* path,
int flags,
int mode,
uv_fs_cb cb);
UV_EXTERN int uv_fs_chmod(uv_loop_t* loop,
uv_fs_t* req,
Expand Down
3 changes: 1 addition & 2 deletions m4/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Ignore libtoolize-generated files.
*.m4
!as_case.m4
!dtrace.m4
!libuv-check-flags.m4
!libuv-check-flags.m4
66 changes: 0 additions & 66 deletions m4/dtrace.m4

This file was deleted.

3 changes: 0 additions & 3 deletions src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
uv__update_time(loop);

while (r != 0 && loop->stop_flag == 0) {
UV_TICK_START(loop, mode);

uv__update_time(loop);
uv__run_timers(loop);
uv__run_pending(loop);
Expand Down Expand Up @@ -340,7 +338,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
}

r = uv__loop_alive(loop);
UV_TICK_STOP(loop, mode);

if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT))
break;
Expand Down
8 changes: 0 additions & 8 deletions src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,4 @@ UV_UNUSED(static char* uv__basename_r(const char* path)) {
return s + 1;
}


#ifdef HAVE_DTRACE
#include "uv-dtrace.h"
#else
#define UV_TICK_START(arg0, arg1)
#define UV_TICK_STOP(arg0, arg1)
#endif

#endif /* UV_UNIX_INTERNAL_H_ */
45 changes: 45 additions & 0 deletions src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,51 @@
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)


struct thread_ctx {
void (*entry)(void* arg);
void* arg;
};


static void* uv__thread_start(void *arg)
{
struct thread_ctx *ctx_p;
struct thread_ctx ctx;

ctx_p = arg;
ctx = *ctx_p;
free(ctx_p);
ctx.entry(ctx.arg);

return 0;
}


int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
struct thread_ctx* ctx;
int err;

ctx = malloc(sizeof(*ctx));
if (ctx == NULL)
return UV_ENOMEM;

ctx->entry = entry;
ctx->arg = arg;

err = pthread_create(tid, NULL, uv__thread_start, ctx);

if (err)
free(ctx);

return err ? -1 : 0;
}


uv_thread_t uv_thread_self(void) {
return pthread_self();
}

int uv_thread_join(uv_thread_t *tid) {
return -pthread_join(*tid, NULL);
}
Expand Down
Loading

0 comments on commit 52ae456

Please sign in to comment.