@@ -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>
@@ -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:
@@ -206,6 +206,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-writealot.c \
test/test-tcp-try-write.c \
test/test-tcp-write-queue-order.c \
test/test-thread-equal.c \
test/test-thread.c \
test/test-threadpool-cancel.c \
test/test-threadpool.c \
@@ -306,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
@@ -4,8 +4,7 @@

libuv is a multi-platform support library with a focus on asynchronous I/O. It
was primarily developed for use by [Node.js](http://nodejs.org), but it's also
used by Mozilla's [Rust language](http://www.rust-lang.org/),
[Luvit](http://luvit.io/), [Julia](http://julialang.org/),
used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/),
[pyuv](https://github.com/saghul/pyuv), and [others](https://github.com/joyent/libuv/wiki/Projects-that-use-libuv).

## Feature highlights
@@ -82,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

@@ -110,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

@@ -120,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:
@@ -128,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
@@ -143,6 +143,10 @@
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
@@ -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-rc2], [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])
@@ -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"], [
@@ -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()``.
@@ -6,15 +6,14 @@ Overview
--------

libuv is a multi-platform support library with a focus on asynchronous I/O. It
was primarily developed for use by `Node.js`_, but it's also used by Mozilla's
`Rust language`_, `Luvit`_, `Julia`_, `pyuv`_, and `others`_.
was primarily developed for use by `Node.js`_, but it's also used by `Luvit`_,
`Julia`_, `pyuv`_, and `others`_.

.. note::
In case you find errors in this documentation you can help by sending
`pull requests <https://github.com/joyent/libuv>`_!

.. _Node.js: http://nodejs.org
.. _Rust language: http://www.rust-lang.org
.. _Luvit: http://luvit.io
.. _Julia: http://julialang.org
.. _pyuv: https://github.com/saghul/pyuv
@@ -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).
@@ -56,8 +56,9 @@ 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)
Thread-local storage
^^^^^^^^^^^^^^^^^^^^
@@ -34,6 +34,6 @@
#define UV_VERSION_MINOR 0
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX "rc2"
#define UV_VERSION_SUFFIX ""

#endif /* UV_VERSION_H */
@@ -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,
@@ -1369,8 +1369,9 @@ UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
typedef void (*uv_thread_cb)(void* arg);

UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
UV_EXTERN unsigned long uv_thread_self(void);
UV_EXTERN uv_thread_t uv_thread_self(void);
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);

/* The presence of these unions force similar struct layout. */
#define XX(_, name) uv_ ## name ## _t name;
@@ -1,5 +1,4 @@
# Ignore libtoolize-generated files.
*.m4
!as_case.m4
!dtrace.m4
!libuv-check-flags.m4
!libuv-check-flags.m4
@@ -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);
@@ -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;
@@ -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_ */
@@ -31,11 +31,61 @@
#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);
}


int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) {
return pthread_equal(*t1, *t2);
}


int uv_mutex_init(uv_mutex_t* mutex) {
#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
return -pthread_mutex_init(mutex, NULL);
@@ -123,12 +123,7 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
uv_spinlock_unlock(&termios_spinlock);

raw = tty->orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag |= (ONLCR);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 1;
raw.c_cc[VTIME] = 0;
cfmakeraw(&raw);

/* Put terminal in raw mode after draining */
if (tcsetattr(fd, TCSADRAIN, &raw))