Commit e276df2b authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #309 from hurtonm/fix_issue_335

Fix issue #335
parents 899778dc cfa6f4bf
...@@ -238,7 +238,13 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_) ...@@ -238,7 +238,13 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
// two instances of the library don't accidentally create signaler // two instances of the library don't accidentally create signaler
// crossing the process boundary. // crossing the process boundary.
// We'll use named event object to implement the critical section. // We'll use named event object to implement the critical section.
HANDLE sync = CreateEvent (NULL, FALSE, TRUE, TEXT("zmq-signaler-port-sync")); // Note that if the event object already exists, the CreateEvent requests
// EVENT_ALL_ACCESS access right. If this fails, we try to open
// the event object asking for SYNCHRONIZE access only.
HANDLE sync = CreateEvent (NULL, FALSE, TRUE, TEXT ("zmq-signaler-port-sync"));
if (sync == NULL && GetLastError () == ERROR_ACCESS_DENIED)
sync = OpenEvent (SYNCHRONIZE, FALSE, TEXT ("zmq-signaler-port-sync"));
win_assert (sync != NULL); win_assert (sync != NULL);
// Enter the critical section. // Enter the critical section.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment