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

Commit

Permalink
unix: port fs and work api to new thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Oct 1, 2012
1 parent 36c91e3 commit 74999f8
Show file tree
Hide file tree
Showing 8 changed files with 526 additions and 708 deletions.
8 changes: 2 additions & 6 deletions config-unix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ifeq (SunOS,$(uname_S))
EV_CONFIG=config_sunos.h
EIO_CONFIG=config_sunos.h
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LINKFLAGS+=-lsocket -lnsl -lkstat
LINKFLAGS+=-lkstat -lnsl -lsendfile -lsocket
OBJS += src/unix/sunos.o
endif

Expand Down Expand Up @@ -137,7 +137,7 @@ endif
RUNNER_LIBS=
RUNNER_SRC=test/runner-unix.c

uv.a: $(OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o
uv.a: $(OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/unix/ev/ev.o src/unix/eio/eio.o
$(AR) rcs uv.a $^

src/%.o: src/%.c include/uv.h include/uv-private/uv-unix.h
Expand All @@ -158,10 +158,6 @@ EIO_CPPFLAGS += -D_GNU_SOURCE
src/unix/eio/eio.o: src/unix/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/unix/eio/eio.c -o src/unix/eio/eio.o

src/unix/uv-eio.o: src/unix/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/unix/eio/ $(CSTDFLAG) $(CFLAGS) -c src/unix/uv-eio.c -o src/unix/uv-eio.o


clean-platform:
-rm -f src/unix/*.o
-rm -f src/unix/ev/*.o
Expand Down
23 changes: 13 additions & 10 deletions include/uv-private/uv-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "ngx-queue.h"

#include "ev.h"
#include "eio.h"

#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -122,13 +121,7 @@ typedef struct {

#define UV_LOOP_PRIVATE_FIELDS \
unsigned long flags; \
/* Poll result queue */ \
eio_channel uv_eio_channel; \
struct ev_loop* ev; \
/* Various thing for libeio. */ \
uv_async_t uv_eio_want_poll_notifier; \
uv_async_t uv_eio_done_poll_notifier; \
uv_idle_t uv_eio_poller; \
ngx_queue_t wq; \
uv_mutex_t wq_mutex; \
uv_async_t wq_async; \
Expand Down Expand Up @@ -256,12 +249,22 @@ typedef struct {
int errorno; \

#define UV_FS_PRIVATE_FIELDS \
struct stat statbuf; \
const char *new_path; \
uv_file file; \
eio_req* eio; \
int flags; \
mode_t mode; \
void* buf; \
size_t len; \
off_t off; \
uid_t uid; \
gid_t gid; \
double atime; \
double mtime; \
struct uv__work work_req; \
struct stat statbuf; \

#define UV_WORK_PRIVATE_FIELDS \
eio_req* eio;
struct uv__work work_req;

#define UV_TTY_PRIVATE_FIELDS \
struct termios orig_termios; \
Expand Down
Loading

0 comments on commit 74999f8

Please sign in to comment.