1. 17 Nov, 2016 5 commits
    • Andrii Grynenko's avatar
      VirtualEventBase · b981b9f2
      Andrii Grynenko authored
      Summary:
      This implements a view onto an EventBase, which can keep track of all tasks created through it and join them on destruction. Multiple VirtualEventBases can be backed by the same EventBase. This can be useful to have the same IO thread/thread-pool be shared between multiple libraries, allowing them to each have it's own VirtualEventBase and control its lifetime.
      
      Since VirtualEventBase also supports LoopKeepAlive and onDestruction functionality, it can be easily integrated with FiberManagerMap.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4158719
      
      fbshipit-source-id: 7df964f36e5276e2b5665fd8394ea2e187aa298c
      b981b9f2
    • Lucian Grijincu's avatar
      folly: ExceptionWrapper: remove <iostream> from header · 0bf2bc29
      Lucian Grijincu authored
      Summary: #accept2ship
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4192095
      
      fbshipit-source-id: eb0cad875bcc24d1c87a99890c51aea31f7024c9
      0bf2bc29
    • Christopher Dykes's avatar
      Add folly::getCurrentThreadID() · 4e42eb8b
      Christopher Dykes authored
      Summary: And also use it in a couple of tests, so that they can be compiled on Windows, where `pthread_t` is a struct rather than a pointer or integer.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4191560
      
      fbshipit-source-id: 5bcf0a2952109b2a9bc5220c4640d42e2cdf8977
      4e42eb8b
    • Delyan Kratunov's avatar
      Remove unneeded iostream include · a64f5cb7
      Delyan Kratunov authored
      Summary:
      Including `iostream` in a header causes anything that uses this header to gain
      an extra static initializer for an `std::ios_base::Init` object.
      If there are N translation units in a library that use the header, that's N
      more static initializers that need to run.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4191798
      
      fbshipit-source-id: 65b47401b9177177999cff65a47ac8dffa0e0546
      a64f5cb7
    • Christopher Dykes's avatar
      Adjust the Function::NonCopyableLambda test to use a large struct rather than a C Array · 7a20ff9c
      Christopher Dykes authored
      Summary:
      Because MSVC doesn't like it when you attempt to explicitly capture a c-style array in a lambda capture list.
      See: https://developercommunity.visualstudio.com/content/problem/2444/cannot-explicitly-capture-c-style-array-in-lambda.html
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4191400
      
      fbshipit-source-id: 305f8086c29f079ccf2c322f20da6393235bc76d
      7a20ff9c
  2. 16 Nov, 2016 8 commits
  3. 15 Nov, 2016 6 commits
  4. 14 Nov, 2016 1 commit
  5. 13 Nov, 2016 1 commit
    • Subodh Iyengar's avatar
      Add ecdsa smart ptr · 4c7d5226
      Subodh Iyengar authored
      Summary: Add ecdsa smart ptr.
      
      Reviewed By: knekritz
      
      Differential Revision: D4173310
      
      fbshipit-source-id: abd5f799b3414b70128635c4390af6f2de329e11
      4c7d5226
  6. 12 Nov, 2016 5 commits
    • Andrii Grynenko's avatar
      Move runAfterDelay/tryRunAfterDelay into TimeoutManager · ab60aed9
      Andrii Grynenko authored
      Summary: This is useful to add more TimeoutManager implementations.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4164236
      
      fbshipit-source-id: 5f2057f6ebfbdc971bc0b5594e3bc4b5a337aaef
      ab60aed9
    • Marcin Pawlowski's avatar
      try to improve folly/io/async/test:async_test - AsyncSocketTest.Write · 8c88eb0a
      Marcin Pawlowski authored
      Summary:
      the test fails a lot as seen on the task.
      To kill the connection in said test, we depeneded
      on destructor, however this uses a delayed destruction
      patter so I guess we did not destroy on time and
      we were failing the tests.
      I close socket explicitly. No idea if this misses
      the point of whole test.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4171111
      
      fbshipit-source-id: 01b8c97a04a2bcdfaeeea522ca8bcae343d6bb5d
      8c88eb0a
    • Mirek Klimos's avatar
      Revert DLOG_INFO warnings about RequestContext being overriden · 8e312461
      Mirek Klimos authored
      Summary: This is causing a log spew on some services, let's remove it until we figure out where the problem is and fix
      
      Differential Revision: D4171379
      
      fbshipit-source-id: 2afdab6917a2498c376559f9171f6e93ab9c8ad7
      8e312461
    • Andrii Grynenko's avatar
      Make Observer.Stress test not fail under load · 5b8add09
      Andrii Grynenko authored
      Reviewed By: marcinpe
      
      Differential Revision: D4171655
      
      fbshipit-source-id: e6ef33c50d5d91e05250520171c959a893470460
      5b8add09
    • Martin Martin's avatar
      When you read from a default-constructed MPMCQueue, assert instead of SIGFPE. · 8712f361
      Martin Martin authored
      Summary:
      I accidentally forgot to specify the capacity for my
      MPMCQueue.  When I then did a blockingRead(), I got a SIGFPE.  Thanks
      to a custom signal handler that doesn't print stack traces, and a few
      more comedy of errors, I lost a day to this.  With this patch, I would
      have gotten an assertion failure instead.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4169033
      
      fbshipit-source-id: fab97ea0d5afc3c06885758b31a5e8c91ae75a45
      8712f361
  7. 11 Nov, 2016 4 commits
    • Mirek Klimos's avatar
      Add warnings when overriding RequestContext · 1d2d4f32
      Mirek Klimos authored
      Summary: We currently store the previous value on creation of RequestContextScopeGuard and reset it to the previous one when it goes out of scope - this means that if it's not unset properly somewhere, we'll prolong its life by saving it and restoring later. We need to do this because of some edge cases but a RequestContext should generally never be overridden by a different RequestContext - let's add a warning if this happens
      
      Reviewed By: djwatson, palmtenor
      
      Differential Revision: D3971904
      
      fbshipit-source-id: e72b5f01102d18977d8aa5f8dca5a7802545098a
      1d2d4f32
    • Andrew Gallagher's avatar
      folly/test/SingletonTestStructs: move inlined function to impl file · d07b730b
      Andrew Gallagher authored
      Reviewed By: yfeldblum
      
      Differential Revision: D4162763
      
      fbshipit-source-id: 25c9bfae2e7679f4b98a3d64ee9f2319eb6e7f4a
      d07b730b
    • Yedidya Feldblum's avatar
      Let folly::range(const std::array<...>&) be constexpr · b2bd22d3
      Yedidya Feldblum authored
      Summary:
      [Folly] Let `folly::range(const std::array<...>&)` be `constexpr`.
      
      This may be useful for future work.
      
      Reviewed By: simpkins
      
      Differential Revision: D4165608
      
      fbshipit-source-id: 8f1064c3cdc07301e198acd596ff26724d603cdd
      b2bd22d3
    • Jim Meyering's avatar
      folly/Foreach.h: fix FOR_EACH_R and FOR_EACH_KV to avoid shadowing warnings · 1dee6ec9
      Jim Meyering authored
      Summary:
      Fix these macros not to self-shadow for nested uses.
      How? Make each local variable name include __LINE__.
      This works in most cases, but not all: if you put the
      nested uses all on one line, you'll still get shadowing warnings.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4161553
      
      fbshipit-source-id: 9e11ae6778272c733a4c820cfb30c5db59998a5b
      1dee6ec9
  8. 10 Nov, 2016 5 commits
    • Christopher Dykes's avatar
      Always use inline-asm version on GCC/Clang · 7213df65
      Christopher Dykes authored
      Summary:
      Because the intrinsic version requires explicitly adding `__target__` attributes, which results in things not being inlined. Although the code generated with the `__target__` attribute is strictly better, ensuring it's applied on all the relevant functions is error-prone, so just use the inline assembly version for GCC/Clang so that it can be inlined elsewhere. MSVC will inline the intrinsic version without any issue.
      This also marks the functions as `ALWAYS_INLINE`, as the diff that is getting reverted made that change as well.
      
      Reviewed By: yfeldblum, philippv, ot
      
      Differential Revision: D3963935
      
      fbshipit-source-id: 47175d64e7be351eb455a4d053b91ce9392bf152
      7213df65
    • Tudor Bosman's avatar
      Add include files necessary to use symbolizer · f588dc4a
      Tudor Bosman authored
      Summary:
      Some include files are not installed, causing including symbolizer/Symbolizer.h to fail.
      Closes https://github.com/facebook/folly/pull/512
      
      Reviewed By: philippv
      
      Differential Revision: D4161113
      
      Pulled By: luciang
      
      fbshipit-source-id: 5a5f8577f8d84ba33f89073781d374b99ba37df6
      f588dc4a
    • Christopher Dykes's avatar
      Don't try to call _free_osfhnd when not compiling agains the static CRT · a9adcd15
      Christopher Dykes authored
      Summary:
      Because, unfortunately, it isn't exported from the dynamic CRT dlls :(
      There's not really a nice way to handle this when using the dynamic CRT without doing very fragile hocus-pocus that relies on the exact layout and implementation details of the file descriptor table in the CRT, so the best we can really do is close the socket and just let the file descriptor itself leak.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4156558
      
      fbshipit-source-id: 32cb4bf357f6746cf6597b66649ff9f018fb1bed
      a9adcd15
    • Phil Willoughby's avatar
      Use std::cerr for folly/Singleton.cpp error printing · a500df07
      Phil Willoughby authored
      Summary:
      Create a local std::ios_base::Init instance to ensure that it is valid, then
      use std::cerr.
      
      Reviewed By: yfeldblum, nbronson
      
      Differential Revision: D4139681
      
      fbshipit-source-id: 03377dd417710e320a6b53298d507fd0168592f6
      a500df07
    • Andrii Grynenko's avatar
      Fix wrong use of upgrade lock · 0416e1ea
      Andrii Grynenko authored
      Reviewed By: yfeldblum, nbronson
      
      Differential Revision: D4149681
      
      fbshipit-source-id: 37bd1b0b7d1ad6e6fa813228307abebfe772012f
      0416e1ea
  9. 09 Nov, 2016 5 commits