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.4 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_ST_SCHEDULER_MJM012402_HPP |
---|
9 | #define BOOST_ST_SCHEDULER_MJM012402_HPP |
---|
10 | |
---|
11 | |
---|
12 | #include <CarbonEvents.h> |
---|
13 | |
---|
14 | |
---|
15 | namespace boost { |
---|
16 | |
---|
17 | namespace threads { |
---|
18 | |
---|
19 | namespace mac { |
---|
20 | |
---|
21 | namespace detail { |
---|
22 | |
---|
23 | |
---|
24 | // class st_scheduler calls its pure-virtual periodic_function method periodically at |
---|
25 | // system task time. This is generally 40Hz under Mac OS 9. |
---|
26 | |
---|
27 | class st_scheduler |
---|
28 | { |
---|
29 | public: |
---|
30 | st_scheduler(); |
---|
31 | virtual ~st_scheduler(); |
---|
32 | |
---|
33 | protected: |
---|
34 | void start_polling(); |
---|
35 | void stop_polling(); |
---|
36 | |
---|
37 | private: |
---|
38 | virtual void periodic_function() = 0; |
---|
39 | |
---|
40 | #if TARGET_CARBON |
---|
41 | // use event loop timers under Carbon |
---|
42 | private: |
---|
43 | static pascal void task_entry(EventLoopTimerRef pTimer, void *pRefCon); |
---|
44 | void task(); |
---|
45 | |
---|
46 | private: |
---|
47 | EventLoopTimerUPP m_uppTask; |
---|
48 | EventLoopTimerRef m_pTimer; |
---|
49 | #else |
---|
50 | // this can be implemented using OT system tasks. This would be mostly a copy-and- |
---|
51 | // paste of the dt_scheduler code, replacing DeferredTask with SystemTask and DT |
---|
52 | // with ST. |
---|
53 | # error st_scheduler unimplemented! |
---|
54 | #endif |
---|
55 | }; |
---|
56 | |
---|
57 | |
---|
58 | } // namespace detail |
---|
59 | |
---|
60 | } // namespace mac |
---|
61 | |
---|
62 | } // namespace threads |
---|
63 | |
---|
64 | } // namespace boost |
---|
65 | |
---|
66 | |
---|
67 | #endif // BOOST_ST_SCHEDULER_MJM012402_HPP |
---|
Note: See
TracBrowser
for help on using the repository browser.