summaryrefslogtreecommitdiff
path: root/ace/Thread_Hook.h
blob: cc9a8ef9623a82b72bb6a353c6dff2de53fe164c (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
// $Id$

// ============================================================================
//
// = LIBRARY
//    ace
//
// = FILENAME
//    Thread_Hook.h
//
// = AUTHOR
//    Carlos O'Ryan <coryan@uci.edu>
//
// ============================================================================

#ifndef ACE_THREAD_HOOK_H
#define ACE_THREAD_HOOK_H
#include "ace/pre.h"

#include "ace/config-all.h"

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

#include "ace/OS_Export.h"

class ACE_OS_Export ACE_Thread_Hook
{
  // = TITLE
  //     This class makes it possible to provide user-defined "start"
  //     hooks that are called before the thread entry point function
  //     is invoked.

public:
  virtual void *start (ACE_THR_FUNC func,
                       void *arg);
  // This method can be overridden in a subclass to customize this
  // pre-function call "hook" invocation that can perform
  // initialization processing before the thread entry point <func>
  // method is called back.  The <func> and <arg> passed into the
  // start hook are the same as those passed by the application that
  // spawned the thread.

  static ACE_Thread_Hook *thread_hook (ACE_Thread_Hook *hook);
  // sets the system wide thread hook, returns the previous thread
  // hook or 0 if none is set.

  static ACE_Thread_Hook *thread_hook (void);
  // Returns the current system thread hook.
};

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