Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various cleanups to zctx #251

Merged
merged 2 commits into from
Sep 29, 2013
Merged

Various cleanups to zctx #251

merged 2 commits into from
Sep 29, 2013

Conversation

hintjens
Copy link
Member

  • Asserts that zocket isn't null when destroying it; the tolerance for
    null sockets is a bogus workaround against corruption of zctx from
    unprotected use in multiple threads.
  • Renamed 'main' to 'shadow' to make more explicit (negative property
    names are not good).
  • Renamed 'socketsMutex' to 'mutex' since (a) camelCase breaks our style
    guidelines, and (b) we have one mutex to protect the object, there is
    no value in qualifying the name.
  • Cleaned up constructors, the code was messy.
  • All methods that modify or read zctx properties needed to be protected
    by the mutex, otherwise we'll get random outcomes.
  • I still do not like the multithreaded zctx; it is incompatible with the
    current code in zthreads (e.g. we don't need shadow contexts) and is
    not sufficiently tested IMO. Also, I still don't see a valid use case
    for it.

* Asserts that zocket isn't null when destroying it; the tolerance for
  null sockets is a bogus workaround against corruption of zctx from
  unprotected use in multiple threads.

* Renamed 'main' to 'shadow' to make more explicit (negative property
  names are not good).

* Renamed 'socketsMutex' to 'mutex' since (a) camelCase breaks our style
  guidelines, and (b) we have one mutex to protect the object, there is
  no value in qualifying the name.

* Cleaned up constructors, the code was messy.

* All methods that modify or read zctx properties needed to be protected
  by the mutex, otherwise we'll get random outcomes.

* I still do not like the multithreaded zctx; it is incompatible with the
  current code in zthreads (e.g. we don't need shadow contexts) and is
  not sufficiently tested IMO. Also, I still don't see a valid use case
  for it.
* Not tested on Windows.
* Defines _CRT_SECURE_NO_DEPRECATE for all MSVC versions above 1500
* Previously was done only for version = 1500
* Usual warnings on new code (casts and signed comparisons), fixed.
pijyoi added a commit that referenced this pull request Sep 29, 2013
@pijyoi pijyoi merged commit 92977bc into zeromq:master Sep 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants