Last change
on this file since 29 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1.3 KB
|
Line | |
---|
1 | // (C) Copyright Mac Murrett 2001. |
---|
2 | // Use, modification and distribution are subject to the |
---|
3 | // Boost Software License, Version 1.0. (See accompanying file |
---|
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
5 | |
---|
6 | // See http://www.boost.org for most recent version. |
---|
7 | |
---|
8 | #ifndef BOOST_EXECUTION_CONTEXT_MJM012402_HPP |
---|
9 | #define BOOST_EXECUTION_CONTEXT_MJM012402_HPP |
---|
10 | |
---|
11 | namespace boost { |
---|
12 | |
---|
13 | namespace threads { |
---|
14 | |
---|
15 | namespace mac { |
---|
16 | |
---|
17 | |
---|
18 | // utility functions for figuring out what context your code is executing in. |
---|
19 | // Bear in mind that at_mp and in_blue are the only functions guarenteed by |
---|
20 | // Apple to work. There is simply no way of being sure that you will not get |
---|
21 | // false readings about task level at interrupt time in blue. |
---|
22 | |
---|
23 | typedef enum { |
---|
24 | k_eExecutionContextSystemTask, |
---|
25 | k_eExecutionContextDeferredTask, |
---|
26 | k_eExecutionContextMPTask, |
---|
27 | k_eExecutionContextOther |
---|
28 | } execution_context_t; |
---|
29 | |
---|
30 | execution_context_t execution_context(); |
---|
31 | |
---|
32 | inline bool at_st() |
---|
33 | { return(execution_context() == k_eExecutionContextSystemTask); } |
---|
34 | |
---|
35 | inline bool at_mp() |
---|
36 | { return(execution_context() == k_eExecutionContextMPTask); } |
---|
37 | inline bool in_blue() |
---|
38 | { return(!at_mp()); } |
---|
39 | |
---|
40 | |
---|
41 | } // namespace mac |
---|
42 | |
---|
43 | } // namespace threads |
---|
44 | |
---|
45 | } // namespace boost |
---|
46 | |
---|
47 | #endif // BOOST_EXECUTION_CONTEXT_MJM012402_HPP |
---|
Note: See
TracBrowser
for help on using the repository browser.