Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/thread/src/mac/dt_scheduler.hpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 1.1 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_DT_SCHEDULER_MJM012402_HPP
9#define BOOST_DT_SCHEDULER_MJM012402_HPP
10
11
12#include "periodical.hpp"
13
14#include <OpenTransport.h>
15
16
17namespace boost {
18
19namespace threads {
20
21namespace mac {
22
23namespace detail {
24
25
26// class dt_scheduler calls its pure-virtual periodic_function method periodically at
27//    deferred task time.  This is generally 1kHz under Mac OS 9.
28
29class dt_scheduler
30{
31  public:
32    dt_scheduler();
33    virtual ~dt_scheduler();
34
35  protected:
36    void start_polling();
37    void stop_polling();
38
39  private:
40    virtual void periodic_function() = 0;
41
42  private:
43    void schedule_task();
44    static pascal void task_entry(void *pRefCon);
45    void task();
46
47  private:
48    bool m_bReschedule;
49    OTProcessUPP m_uppTask;
50    long m_lTask;
51};
52
53
54} // namespace detail
55
56} // namespace mac
57
58} // namespace threads
59
60} // namespace boost
61
62
63#endif // BOOST_DT_SCHEDULER_MJM012402_HPP
Note: See TracBrowser for help on using the repository browser.