Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit df5be47

Browse files
committed
Revert "win pipe: race condition on queueing uv_pipe_zero_readfile_thread_proc"
This reverts commit dd0702a. See discussion at JuliaLang/libuv@de067bc#commitcomment-14457130
1 parent ccc2a71 commit df5be47

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: src/win/pipe.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ static DWORD WINAPI uv_pipe_zero_readfile_thread_proc(void* parameter) {
11141114
assert(handle->type == UV_NAMED_PIPE);
11151115

11161116
if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
1117+
uv_mutex_lock(m); /* mutex controls *setting* of readfile_thread */
11171118
if (DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
11181119
GetCurrentProcess(), &hThread,
11191120
0, TRUE, DUPLICATE_SAME_ACCESS)) {
@@ -1247,13 +1248,9 @@ static void uv_pipe_queue_read(uv_loop_t* loop, uv_pipe_t* handle) {
12471248
req = &handle->read_req;
12481249

12491250
if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
1250-
if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE)
1251-
uv_mutex_lock(&handle->pipe.conn.readfile_mutex); /* mutex controls *setting* of readfile_thread */
12521251
if (!QueueUserWorkItem(&uv_pipe_zero_readfile_thread_proc,
12531252
req,
12541253
WT_EXECUTELONGFUNCTION)) {
1255-
if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE)
1256-
uv_mutex_unlock(&handle->pipe.conn.readfile_mutex);
12571254
/* Make this req pending reporting an error. */
12581255
SET_REQ_ERROR(req, GetLastError());
12591256
goto error;

0 commit comments

Comments
 (0)