Explicitly refer to the std::chrono namespace to avoid conflicts with the folly:...
authorChristopher Dykes <cdykes@fb.com>
Wed, 13 Dec 2017 20:49:43 +0000 (12:49 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 13 Dec 2017 20:51:15 +0000 (12:51 -0800)
Summary:
This is a hard requirement due to an upcoming change in Folly.

The codemod was only run on files that referenced the `std::chrono` namespace with an unqualified `chrono` and also used both the `std` and `folly` namespaces.
```
fbgr -sl "[^:]chrono::" | xargs grep -l "using namespace std;" | xargs grep -l "using namespace folly;" | xargs sed -r -i 's/([^:])chrono::([a-z])/\1std::chrono::\2/g'
```

Reviewed By: yfeldblum

Differential Revision: D6547864

fbshipit-source-id: 4a8230d311edbaa173722a09b2773e8d053fae7e

folly/io/async/test/EventHandlerTest.cpp

index feb2f77414bd0c4aab1620b430033f04c5cb0691..9e4bc7f1b3448200ab4da08914eddaafe426c3e5 100644 (file)
@@ -128,7 +128,8 @@ TEST_F(EventHandlerTest, many_concurrent_producers) {
         runInThreadsAndWait(nproducers,
                             [&](size_t /* k */) {
                               for (size_t i = 0; i < writes / nproducers; ++i) {
-                                this_thread::sleep_for(chrono::milliseconds(1));
+                                this_thread::sleep_for(
+                                    std::chrono::milliseconds(1));
                                 efd_write(1);
                               }
                             });
@@ -175,7 +176,8 @@ TEST_F(EventHandlerTest, many_concurrent_consumers) {
         runInThreadsAndWait(nproducers,
                             [&](size_t /* k */) {
                               for (size_t i = 0; i < writes / nproducers; ++i) {
-                                this_thread::sleep_for(chrono::milliseconds(1));
+                                this_thread::sleep_for(
+                                    std::chrono::milliseconds(1));
                                 queue.blockingWrite(nullptr);
                                 efd_write(1);
                                 --writesRemaining;