~ubuntu-branches/ubuntu/wily/ruby-passenger/wily-proposed

« back to all changes in this revision

Viewing changes to ext/boost/thread/thread_functors.hpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-11-23 23:50:02 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131123235002-8fdhsq7afj15o2z2
Tags: 4.0.25-1
* New upstream release.
* Refresh fix_install_path.patch.
* Build for Ruby 2.0 instead of 1.8. (Closes: #725591)
* Add fix_ftbfs_fortify_source.patch.
* Install passenger template files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Distributed under the Boost Software License, Version 1.0. (See
 
2
// accompanying file LICENSE_1_0.txt or copy at
 
3
// http://www.boost.org/LICENSE_1_0.txt)
 
4
// (C) Copyright 2009-2012 Anthony Williams
 
5
// (C) Copyright 2012 Vicente J. Botet Escriba
 
6
 
 
7
// Based on the Anthony's idea of scoped_thread in CCiA
 
8
 
 
9
#ifndef BOOST_THREAD_THREAD_FUNCTORS_HPP
 
10
#define BOOST_THREAD_THREAD_FUNCTORS_HPP
 
11
 
 
12
#include <boost/thread/detail/config.hpp>
 
13
#include <boost/thread/detail/delete.hpp>
 
14
#include <boost/thread/detail/move.hpp>
 
15
#include <boost/thread/thread_only.hpp>
 
16
 
 
17
#include <boost/config/abi_prefix.hpp>
 
18
 
 
19
namespace boost
 
20
{
 
21
 
 
22
  struct detach
 
23
  {
 
24
    void operator()(thread& t)
 
25
    {
 
26
      t.detach();
 
27
    }
 
28
  };
 
29
 
 
30
  struct join_if_joinable
 
31
  {
 
32
    void operator()(thread& t)
 
33
    {
 
34
      if (t.joinable())
 
35
      {
 
36
        t.join();
 
37
      }
 
38
    }
 
39
  };
 
40
 
 
41
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
 
42
  struct interrupt_and_join_if_joinable
 
43
  {
 
44
    void operator()(thread& t)
 
45
    {
 
46
      t.interrupt();
 
47
      if (t.joinable())
 
48
      {
 
49
        t.join();
 
50
      }
 
51
    }
 
52
  };
 
53
#endif
 
54
}
 
55
#include <boost/config/abi_suffix.hpp>
 
56
 
 
57
#endif