Commit Graph

15 Commits

Author SHA1 Message Date
Ben Noordhuis
150b6a71c9 unix: add spinlock.h
Add an atomic, non-blocking spinlock type.  The primary use case is to
have a mutex type that we can use while inside a signal handler.
2013-10-20 13:58:34 +02:00
Ben Noordhuis
a3c3b37bfb unix: add atomic-ops.h
Add cmpxchgi(), cmpxchgl() and cpu_relax() functions that we can use
as simple primitives to build spinlocks out of.
2013-10-20 13:58:34 +02:00
Timothy J Fontaine
717e0e5635 build: use -pthread on sunos
When building on sunos with autoconf make sure to specify -pthread
otherwise there will be race conditions with errno and etc
2013-09-20 10:50:19 -07:00
Saúl Ibarra Corretgé
2b9c374c1c windows: run close callbacks after polling for i/o
Makes the uv-win behavior compatible with uv-unix.

Fixes #796.
2013-09-06 06:28:42 +02:00
Brent Cook
c363cd0dba build: include internal headers in source list
Allows 'make dist-*' targets to generate working tarballs.
2013-09-04 01:09:42 +02:00
Ben Noordhuis
d48168afd0 darwin: remove CoreFoundation dependency
Load the required symbols at run-time rather than linking against the
CoreFoundation (and CoreServices and ApplicationServices) frameworks
at build time.

Should make integration easier for people that bundle libuv with their
own projects because they no longer have to replicate magic -framework
incantations in their top-level build system.
2013-08-27 23:58:21 +02:00
Keno Fischer
e52aa6cc57 build: make autotools build system work with mingw 2013-08-24 21:49:37 +02:00
Timothy J Fontaine
1a177d7028 build: apply dtrace -G to all object files
fixes #871
2013-08-12 09:48:25 -07:00
Ben Noordhuis
1510ce81fd unix, windows: allow NULL async callback
Allow a NULL callback so the user doesn't have to provide a dummy when
the actual event is processed by e.g. a check handle callback.
2013-08-12 08:55:51 +02:00
Ben Noordhuis
c82cea1ec5 build: enable AM_INIT_AUTOMAKE([subdir-objects])
Squelches (justified) warnings with automake 1.14.

Object files are built in subdirectories now so fix up the dtrace
postprocessing step to scan for *.lo files in said subdirectories.

Fixes #866.
2013-07-29 00:36:49 +02:00
Timothy J Fontaine
b13941cf17 build: dtrace shouldn't break out of tree builds
Fixes #848.
2013-07-25 12:12:48 +02:00
Ben Noordhuis
3ee4d3f183 unix, windows: return error codes directly
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like this one:

    if (uv_foo(loop) < 0) {
      uv_err_t err = uv_last_error(loop);
      fprintf(stderr, "%s\n", uv_strerror(err));
    }

Should be rewritten like this:

    int err = uv_foo(loop);
    if (err < 0)
      fprintf(stderr, "%s\n", uv_strerror(err));

The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
2013-07-07 09:51:00 +02:00
Miroslav Bajtoš
fd45f876ff linux,darwin,win: link-local IPv6 addresses
Modified uv_ip6_addr() to fill sin6_scope_id for link-local addresses.

Fixes #271

Conflicts:
	build.mk
2013-07-04 15:43:20 +02:00
Timothy J Fontaine
2f3124a8c1 build: add DTrace detection for autotools 2013-07-03 16:04:01 -07:00
Ben Noordhuis
ddd7e04fd6 build: switch to autotools
Switch to the build tool everyone loves to hate.  The Makefile has
served us well over the years but it's been acquiring more and more
features that autotools gives us for free, like easy static+shared
library building, sane install targets, and so on.

This commit drops MinGW support.  If there is demand for it, we'll
re-add it.
2013-07-02 01:21:16 +02:00