ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pthread-fiber-manager.h
Go to the documentation of this file.
1 #ifndef PTHREAD_FIBER_MANAGER_H
2 #define PTHREAD_FIBER_MANAGER_H
3 
4 #include "fiber-manager.h"
5 #include <signal.h>
6 #include <list>
7 
8 namespace ns3 {
9 
10 struct PthreadFiber;
11 class StackTrampoline;
12 
14 {
15 public:
17  virtual ~PthreadFiberManager ();
18  virtual struct Fiber * Clone (struct Fiber *fiber);
19  virtual struct Fiber *Create (void (*callback)(void *),
20  void *context,
21  uint32_t stackSize);
22  virtual struct Fiber * CreateFromCaller (void);
23  virtual void Delete (struct Fiber *fiber);
24  virtual void SwitchTo (struct Fiber *from,
25  const struct Fiber *to);
26  virtual uint32_t GetStackSize (struct Fiber *fiber) const;
27  virtual void SetSwitchNotification (void (*fn)(void));
28 private:
29  static void * Run (void *arg);
30  void Yield (struct PthreadFiber *fiber);
31  void Wakeup (struct PthreadFiber *fiber);
32  void Start (struct PthreadFiber *fiber);
33  static void * SelfStackBottom (void);
34  void RestoreFiber (struct PthreadFiber *fiber);
35  void (*m_notifySwitch)(void);
37 };
38 
39 } // namespace ns3
40 
41 #endif /* PTHREAD_FIBER_MANAGER_H */