summaryrefslogtreecommitdiff
path: root/TAO/tao/Wait_On_LF_No_Upcall.h
blob: 8c839eba3bccc027a262164f2ad3515a0abdecf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Wait_On_LF_No_Upcall.h
 *
 *  $Id$
 *
 *  @author  Chris Cleeland <cleeland@ociweb.com>
 */
//=============================================================================


#ifndef TAO_WAIT_ON_LF_NO_UPCALL_H
#define TAO_WAIT_ON_LF_NO_UPCALL_H

#include /**/ "ace/pre.h"

#include "tao/Wait_On_Leader_Follower.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{
  /**
   * @class TAO_Wait_On_LF_No_Upcall
   *
   * @brief Wait according to the Leader-Follower model (like
   * TAO_Wait_On_Leader_Follower), but do not allow nested upcalls.
   *
   * This implementation sets a thread-specific flag on entering wait()
   * that indicates that the thread is unavailable to service upcalls.
   * Connection handler that are acting in a server role cooperate by
   * checking this flag in their handle_input, and returning if they're
   * in a thread that is currently suspending upcalls.  The flag gets
   * reset once the reply is received.
   */

  class Wait_On_LF_No_Upcall : public TAO_Wait_On_Leader_Follower
  {
  public:

    typedef TAO_Wait_On_Leader_Follower base;

    Wait_On_LF_No_Upcall (TAO_Transport *t);

    virtual ~Wait_On_LF_No_Upcall (void);

    virtual int wait (ACE_Time_Value *max_wait_time,
                      TAO_Synch_Reply_Dispatcher &rd);

    virtual bool can_process_upcalls (void) const;
  };
}

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"

#endif /* TAO_WAIT_ON_LF_NO_UPCALL_H */