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

Commit

Permalink
Revert "Add uv_pipe_pair for communication between threads"
Browse files Browse the repository at this point in the history
Not needed. We took a different approach for isolates.

This reverts commit 5cc6090.
  • Loading branch information
ry committed Jan 9, 2012
1 parent 5cc6090 commit 4ad33e9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 190 deletions.
7 changes: 0 additions & 7 deletions include/uv.h
Expand Up @@ -784,13 +784,6 @@ struct uv_pipe_s {
*/
UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);

/*
* Connects two initialized pipes on different loops.
* Data written to one pipe will appear on the other side.
* This function is thread-safe.
*/
UV_EXTERN uv_err_t uv_pipe_pair(uv_pipe_t* a, uv_pipe_t* b);

/*
* Opens an existing file descriptor or HANDLE as a pipe.
*/
Expand Down
36 changes: 0 additions & 36 deletions src/unix/pipe.c
Expand Up @@ -30,10 +30,6 @@
#include <stdlib.h>


static uv_once_t uv__pipe_pair_lock_guard = UV_ONCE_INIT;
static uv_mutex_t uv__pipe_pair_lock;


int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
uv__stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE);
loop->counters.pipe_init++;
Expand All @@ -43,38 +39,6 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
}


void uv__pipe_pair_lock_init() {
uv_mutex_init(&uv__pipe_pair_lock);
}


uv_err_t uv_pipe_pair(uv_pipe_t* a, uv_pipe_t* b) {
int fds[2];
int r;
uv_err_t err;

/* Make sure that the mutex is only initialized once. */
uv_once(&uv__pipe_pair_lock_guard, uv__pipe_pair_lock_init);

uv_mutex_lock(&uv__pipe_pair_lock);

r = uv__make_socketpair(fds, UV__F_NONBLOCK | UV__F_IPC);

if (r) {
err = uv__new_sys_error(errno);
} else {
uv_pipe_open(a, fds[0]);
uv_pipe_open(b, fds[1]);
err = uv_ok_;
}

uv_mutex_unlock(&uv__pipe_pair_lock);

return err;
}



int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
struct sockaddr_un saddr;
const char* pipe_fname;
Expand Down
6 changes: 0 additions & 6 deletions src/win/pipe.c
Expand Up @@ -91,12 +91,6 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
}


uv_err_t uv_pipe_pair(uv_pipe_t* a, uv_pipe_t* b) {
/* Implement me */
return uv__new_artificial_error(UV_ENOSYS);
}


static void uv_pipe_connection_init(uv_pipe_t* handle) {
uv_connection_init((uv_stream_t*) handle);
handle->read_req.data = handle;
Expand Down
3 changes: 0 additions & 3 deletions test/test-list.h
Expand Up @@ -29,7 +29,6 @@ TEST_DECLARE (tcp_ping_pong_v6)
TEST_DECLARE (tcp_ref)
TEST_DECLARE (tcp_ref2)
TEST_DECLARE (pipe_ping_pong)
TEST_DECLARE (pipe_pair)
TEST_DECLARE (delayed_accept)
TEST_DECLARE (multiple_listen)
TEST_DECLARE (tcp_writealot)
Expand Down Expand Up @@ -164,8 +163,6 @@ TASK_LIST_START
TEST_ENTRY (pipe_ping_pong)
TEST_HELPER (pipe_ping_pong, pipe_echo_server)

TEST_ENTRY (pipe_pair)

TEST_ENTRY (delayed_accept)
TEST_ENTRY (multiple_listen)

Expand Down
137 changes: 0 additions & 137 deletions test/test-pipe-pair.c

This file was deleted.

1 change: 0 additions & 1 deletion uv.gyp
Expand Up @@ -302,7 +302,6 @@
'test/test-ping-pong.c',
'test/test-pipe-bind-error.c',
'test/test-pipe-connect-error.c',
'test/test-pipe-pair.c',
'test/test-platform-output.c',
'test/test-process-title.c',
'test/test-ref.c',
Expand Down

0 comments on commit 4ad33e9

Please sign in to comment.