-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46395/#review131755
-----------------------------------------------------------




3rdparty/libprocess/src/process.cpp (lines 896 - 897)
<https://reviews.apache.org/r/46395/#comment195786>

    ```cpp
      if (::setsockopt(
              __s__->get(),
              SOL_SOCKET,
              SO_REUSEADDR,
              reinterpret_cast<char*>(&on),
              sizeof(on)) < 0) {
    ```



3rdparty/libprocess/src/process.cpp (lines 2240 - 2269)
<https://reviews.apache.org/r/46395/#comment195787>

    Consider this if you would to preserve the guarantee:
    
    ```cpp
      struct
      {
        void operator()() const
        {
          do {
            ProcessBase* process = process_manager->dequeue();
            if (process == NULL) {
              Gate::state_t old = gate->approach();
              process = process_manager->dequeue();
              if (process == NULL) {
                if (joining_threads.load()) {
                  break;
                }
                gate->arrive(old);
                // Wait
                // at
                // gate
                // if
                // idle.
                continue;
              } else {
                gate->leave();
              }
            }
            process_manager->resume(process);
          } while (true);
        }
    
        // We hold a constant reference to `joining_threads` to make it clear 
that this
        // value is only being tested (read), and not manipulated.
        const std::atomic_bool& joining_threads;
      } worker{joining_threads};
    
      // Create processing threads.
      for (long i = 0; i < num_worker_threads; i++) {
        // Retain the thread handles so that we can join when shutting down.
        threads.emplace_back(new std::thread(worker));
      }
    ```


- Michael Park


On April 23, 2016, 11:26 p.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> -----------------------------------------------------------
> 
> (Updated April 23, 2016, 11:26 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
>     https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/process.cpp 
> 8727eb202e9699f0ac3c95788257cf1a22b0da7b 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>

Reply via email to